471,594 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

Tooltip on Combobox disappears - Windows Forms bug?

I am using .NET 2.0 forms and running on Windows XP SP2. When I have a
tooltip on a combo box, and the combo box is expanded (“dropped down”)
using the arrow, it will no longer display it’s tooltip, no matter how
long I hover. Even if I move off the control and back it will still not
display its tooltip. If I then go to another control that has tootips,
then back to the combobox, it will again display its tooltip, until the
next time it is expanded.

Below is a small sample that has this bug (on my machine anyway.) It is
simply the standard VS8.0 generated code, condensed. Strangely, if I
remove the EnableVisualStyles() line, then the tootips seem to work
correctly.

I could not find any information about this bug. I am curious if anyone
else has come across it, and if there is a solution? Any help appreciated.
======= Buildable Code Sample Below

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace ComboTest
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}
}

class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
// comboBox1
this.comboBox1.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(12, 59);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 0;
this.toolTip1.SetToolTip(this.comboBox1, "Combo Tooltip");
// button1
this.button1.Location = new System.Drawing.Point(12, 12);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.toolTip1.SetToolTip(this.button1, "Button tip.");
this.button1.UseVisualStyleBackColor = true;
// Form1
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button1);
this.Controls.Add(this.comboBox1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.Button button1;
}
}
====== END Code Sample

Feb 6 '07 #1
0 2006

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Simon Richardson | last post: by
4 posts views Thread by JerryP | last post: by
11 posts views Thread by Timo Kunze | last post: by
2 posts views Thread by Paul E Collins | last post: by
5 posts views Thread by =?Utf-8?B?cGV0ZTE5Njk=?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.