开发者

Display tooltip for items in combobox in C# winforms

I am trying to display tooltip for items in combobox. I tried this code in combobox selected index c开发者_Go百科hanged event but it does not work as expected.

ToolTip toolTip1 = new ToolTip();
toolTip1.AutoPopDelay = 5;
toolTip1.InitialDelay = 0;
toolTip1.ReshowDelay = 0;
toolTip1.ShowAlways = true;
for (int i = 0; i < cbo.Items.Count; i++)
{
  toolTip1.SetToolTip(this.cbo, cboCounty.Items[cbo.SelectedIndex].ToString()); 
}             

As it is not possible to add tooltip to combobox control directly, we may have to create a user control for implementing this functionality. Can anyone guide to create a customized combobox which displays tooltips for items in it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜