I have searched different solutions, but no one has given me direct answer or written in vb.net. But my position is that I have a combo box
, in which some items that the user can select. I want to add simple tooltips, so each user knows what he is choosing. However, the tooltip is not visible unless an item is selected. I want to show the tooltip when the mouse is rooted on each item.
Below is my code:
private sub VotingAgentComboBox_MouseHover (ByVal as) VotingAgentComboBox.MouseHover dim VotingAgentToolTip handle as this System.Object, ByVal e System.EventArgs as New ToolTip VotingAgentComboBox.Text = "ISS" then VotingAgentToolTip.SetToolTip (VotingAgentComboBox, "you selected ISS") End Sub
try this .. add tooltip control to your form and control
and the tellmode property of the OwnerDrawFixed set to be told For the event DrawItem
write this code> if (e.index == -1) {return; } Point P = new point (ComboBox1.Location.X + 120, ComboBox1.Location.Y + ComboBox1.Height + (30 + e.Index * 10)); If ((e.State & amp; DrawItemState.Selected) == DrawItemState.Selected) {toolTip.Show (ComboBox1.Items [e.Index] (.ToString), this, P); } E.DrawBackground (); e.Graphics.DrawString (ComboBox1.Items [e.Index] .ToString (), e.Font, Brushes.Black, new Point (e.Bounds.X, e.Bounds.Y));
Comments
Post a Comment