C#,怎样在一个复选按钮上显示提示 一个复选按钮组,怎么在每个复选按钮组上显示不同的提示,按钮个数是不定的! 就是鼠标指在复选按钮上,就出现提示的那种!谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 this.toolTip1.SetToolTip(this.checkBox1 ,"显示的提示"); 用的是tooltip控件,不是属性,给分吧 不知道楼主的个数不定是怎么样的,试试下面代码在页面上加一人ToolTip1,在CheckBox的_MouseMove事件里加入:System.Collections.IEnumerator ea = this.Controls.GetEnumerator();while (ea.MoveNext()){ if (ea.Current.GetType().Name == "CheckBox") { CheckBox cb = (CheckBox)ea.Current; if (cb.Checked == true) { this.toolTip1.SetToolTip(cb, cb.Name); } }} 还是不明白,是一个动态的复选按钮组,CheckBoxList还有,我怎么找不到toolTip控件 ds=c_wx.get_wx_word(w_x,sex); for(int i=0;i<ds.Tables[0].Rows.Count;i++) { string str1=ds.Tables[0].Rows[i]["w_p_sense"].ToString().Trim(); string str2=ds.Tables[0].Rows[i]["w_p_word"].ToString().Trim(); CheckBoxList1.Items.Add("<a onmouseover=showMsg('"+str1+"','"+str2+"') onmouseout=hideMsg()>"+str2+"</a>"); CheckBoxList1.Items[i].Value=str2; }这是我的代码,str2为复选按钮的内容,str1为提示内容,每个提示内容不一样 用foreach给每个项加上一个属性 foreach ( ListItem i in CheckBoxList1.Items){ i.Attributes["title"] ="提示";} 请问一下,这个 i.Attributes["title"] ="提示";中的["title"]是哪个属性? 你是webform还是winform我说的是webform里面的.title就是提示的属性. webform 不明白,我试了下,不行,还是没有提示出现 我用的是webformds=c_wx.get_wx_word(w_x,sex);for(int i=0;i<ds.Tables[0].Rows.Count;i++){string str1=ds.Tables[0].Rows[i]["w_p_sense"].ToString().Trim();string str2=ds.Tables[0].Rows[i]["w_p_word"].ToString().Trim();CheckBoxList1.Items.Add("<a onmouseover=showMsg('"+str1+"','"+str2+"') onmouseout=hideMsg()>"+str2+"</a>");CheckBoxList1.Items[i].Value=str2; foreach ( ListItem l in CheckBoxList1.Items){ l.Attributes["title"] =str1;}}这样写还是不行 关于C#调用openoffice类库的问题 创建窗口句柄时出现错误?紧急。。。。 求救:用c#如何对cad2007将选中的文本进行大小写转换 请教winform中事物处理!(送分题目) 菜鸟求救 C#编程问题 求救~~~~~~~!!!谢谢(comboBox控件邦定数据时怎样获取的控件中的内容) 关于Marshal.GetFunctionPointerForDelegate 函数的问题 listView种颜色问题 急需深圳到长沙或衡阳的火车票,请联系13824321576 怎样用c#取一副图象的象素 c# 编写activeX控件无法正常显示 如何包装一个程序?
while (ea.MoveNext())
{
if (ea.Current.GetType().Name == "CheckBox")
{
CheckBox cb = (CheckBox)ea.Current;
if (cb.Checked == true)
{
this.toolTip1.SetToolTip(cb, cb.Name);
}
}
}
还有,我怎么找不到toolTip控件
for(int i=0;i<ds.Tables[0].Rows.Count;i++)
{
string str1=ds.Tables[0].Rows[i]["w_p_sense"].ToString().Trim();
string str2=ds.Tables[0].Rows[i]["w_p_word"].ToString().Trim();
CheckBoxList1.Items.Add("<a onmouseover=showMsg('"+str1+"','"+str2+"') onmouseout=hideMsg()>"+str2+"</a>");
CheckBoxList1.Items[i].Value=str2;
}
这是我的代码,str2为复选按钮的内容,str1为提示内容,每个提示内容不一样
foreach ( ListItem i in CheckBoxList1.Items)
{
i.Attributes["title"] ="提示";
}
我说的是webform里面的.
title就是提示的属性.
不明白,我试了下,不行,还是没有提示出现
ds=c_wx.get_wx_word(w_x,sex);
for(int i=0;i<ds.Tables[0].Rows.Count;i++)
{
string str1=ds.Tables[0].Rows[i]["w_p_sense"].ToString().Trim();
string str2=ds.Tables[0].Rows[i]["w_p_word"].ToString().Trim();
CheckBoxList1.Items.Add("<a onmouseover=showMsg('"+str1+"','"+str2+"') onmouseout=hideMsg()>"+str2+"</a>");
CheckBoxList1.Items[i].Value=str2;
foreach ( ListItem l in CheckBoxList1.Items)
{
l.Attributes["title"] =str1;
}
}
这样写还是不行