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];
}
}
查看全文
相关阅读:
【Leetcode】【Easy】Remove Duplicates from Sorted List
【Leetcode】【Easy】Pascal's Triangle II
【Leetcode】【Easy】Pascal's Triangle
【Leetcode】【Easy】Binary Tree Level Order Traversal II
【Leetcode】【Easy】Binary Tree Level Order Traversal
【Leetcode】【Easy】Maximum Depth of Binary Tree
【Leetcode】【Easy】Minimum Depth of Binary Tree
【Leetcode】【Easy】Balanced Binary Tree
【Leetcode】【Easy】Symmetric Tree
如何使用Action.Invoke()触发一个Storyboard
原文地址:https://www.cnblogs.com/taowen/p/21165.html
最新文章
Mxgraph使用总结一
Java中的Static详解
Maven里头的pom.xml配置详解
Java邮箱发送——企业版
Oracl使用总结二
IE8提示console未定义
CS229 6.2 Neurons Networks Backpropagation Algorithm
CS229 6.1 Neurons Networks Representation
CS229 5.用正则化(Regularization)来解决过拟合
CS229 3.用Normal Equation拟合Liner Regression模型
热门文章
CS229 2.深入梯度下降(Gradient Descent)算法
CS229 1 .线性回归与特征归一化(feature scaling)
文本分类过程中的朴素贝叶斯多项式与伯努力模型
维数灾难与梯度爆炸
维数灾难
机器学习算法思想简单梳理
梯度下降法及其实现
用深度学习解决自然语言处理中的7大问题,文本分类、语言建模、机器翻译
神经网络反向传播梯度计算数学原理
【Leetcode】【Easy】Remove Duplicates from Sorted Array
Copyright © 2011-2022 走看看