DropDownList中的項目加入ToolTip的資訊
在開發程式的過程中,經常會用到DropDownList來繫結項目或自訂項目,然而如果繫結的項目需顯示額外的資訊,
透過ToolTip即可將所需的資訊不佔空間地顯示出來,使用的方法如下:
1
DropDownList.Items.Add("Item1")
2
DropDownList.Items(0).Attributes.Add("title", "This is Item1!")

2

透過類似上述的方式即可在DropDownList的每一個項目都有各自不同的ToolTip!