private void Form2_Load(object sender, EventArgs e) { comboBox1.DrawMode = DrawMode.OwnerDrawFixed; } private void comboBox1_DrawItem(object sender, DrawItemEventArgs e) { string text = comboBox1.GetItemText(comboBox1.Items[e.Index]); e.DrawBackground(); using (SolidBrush br = new SolidBrush(e.ForeColor)) { e.Graphics.DrawString(text, e.Font, br, e.Bounds); } if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) { toolTip1.Show(text, comboBox1, e.Bounds.Right, e.Bounds.Bottom); } e.DrawFocusRectangle(); } private void comboBox1_DropDownClosed(object sender, EventArgs e) { toolTip1.Hide(comboBox1); }
this.DoubleBuffered = true;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)