例如你有一个Button事件:
private void Button1_Click(object sender, System.EventArgs e)
{
for(int i=0;i<Management.Items.Count;i++)
{
if(Management.Items[i].Selected==true)
{
//do something
return;
}
}
Label1.Text="至少要选择其中一项"; }
RadioButtonList一样适用.
private void Button1_Click(object sender, System.EventArgs e)
{
for(int i=0;i<Management.Items.Count;i++)
{
if(Management.Items[i].Selected==true)
{
//do something
return;
}
}
Label1.Text="至少要选择其中一项"; }
RadioButtonList一样适用.
解决方案 »
- datagridview虚拟模式加载数据
- 怎么用C#实现用键盘上的上下左右键来控制游戏中的人物
- C#如何读写INI文件???
- 请教一个在程序中关闭其他程序的问题
- 如何在winform的客户端程序中登陆asp.net的OA系统
- 谁能帮忙讲一下,winform下多个窗体公用一个连接数据库的方法
- 请问怎么快速便捷的将string a="0"转换成 a="0.00"
- VS2005Beta2问题。
- 我想用C#写一个Windows Mobile上的Notepad。
- 关于C#工程项目问题!!寻求解决方案~
- 请问,如何在treeView获得驱动器和文件夹的信息?
- 题外话现在北京用.NET做项目的多不多,薪金怎么样,我不知道现在要不要继续学习下去
if the value is null, procsss the error handler.
private void chklstTable_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
{
if(this.chklstTable.CheckedIndices.Count<2&&e.NewValue==System.Windows.Forms.CheckState.Unchecked)
{
e.NewValue = System.Windows.Forms.CheckState.Checked;
}
}