zoukankan
html css js c++ java
贴两段代码
因为没有找到如何在ComboBox和ListBox中的item附加tag的办法,所以自己添加了一下。主要是试验一下如何用博客园新加的代码高亮这个酷酷的功能:
public
class
FlexComboBox : System.Windows.Forms.ComboBox
{
private
System.Collections.ArrayList ItemValues
=
new
System.Collections.ArrayList();
public
void
FlexAddItem(
string
itemText,
object
itemValue)
{
this
.Items.Add(itemText);
ItemValues.Add(itemValue);
}
public
object
FlexGetSelectedItemValue()
{
return
ItemValues[
this
.SelectedIndex];
}
public
void
FlexClearItems()
{
ItemValues.Clear();
this
.Items.Clear();
}
}
public
class
FlexListBox : System.Windows.Forms.ListBox
{
private
ArrayList itemValues
=
new
ArrayList();
public
FlexListBox()
{ }
public
void
FlexAddItem(
string
itemText,
object
itemValue)
{
this
.Items.Add(itemText);
itemValues.Add(itemValue);
}
public
void
FlexRemoveSelectedItems()
{
for
(
int
i
=
0
;i
<
this
.SelectedIndices.Count;i
++
)
{
int
index
=
this
.SelectedIndices[i];
this
.Items.RemoveAt(index);
itemValues.RemoveAt(index);
}
}
public
void
FlexClearItems()
{
itemValues.Clear();
this
.Items.Clear();
}
public
ArrayList FlexGetItemValues()
{
return
itemValues;
}
public
object
FlexGetSelectedValue()
{
return
itemValues[
this
.SelectedIndex];
}
}
查看全文
相关阅读:
小米智能家居接入智能家居平台homeassistant的方法
我的nodejs 快速入门
node.js JS对象和JSON字符串之间的转换
Mac安装搭建sublimeText3开发Nodejs环境
使用Xcode IDE写node.js
nodejs中exports与module.exports的区别
安装pysqlite2
linux 终端分屏命令
MQTT学习笔记
Cache缓存
原文地址:https://www.cnblogs.com/taowen/p/21165.html
最新文章
wget断点续传下载需要登录的网站上的大文件
Oracle学习网站(视频)
Java获取yahoo天气预报
Maven学习日记(二)---MAVEN创建多模块的项目
Maven学习日记(一)----构建web项目
Maven中央仓库——你可能不知道的细节
zqgame《每日一言》
[转]Oracle 执行计划(Explain Plan) 说明
基于jQuery的计算文本框字数的代码-jquery
经典励志书籍
热门文章
经典励志电影
日记整理---->2017-05-14
日记整理---->2017-05-17
日记整理---->2016-11-26
日记整理---->2016-11-23
日记整理---->2016-11-22
日记整理---->2016-11-01
java高级---->Thread之ScheduledExecutorService的使用
java高级---->Thread之CompletionService的使用
java高级---->Thread之CyclicBarrier的使用
Copyright © 2011-2022 走看看