E
Edward
Hi all,
In my application I have modal form and controls on this
form have tooltips. I do not recreate instance of the
form, only hide it and show again. But after second
ShowModal all tooltips disapear. Is this known bug, or I
do something wrong?
Sample code illustrates this behavior:
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button
button1;
private System.Windows.Forms.ToolTip
toolTip1;
public Form1()
{
this.button1 = new
System.Windows.Forms.Button();
this.toolTip1 = new
System.Windows.Forms.ToolTip();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new
System.Drawing.Point(16, 8);
this.button1.Name = "button1";
this.button1.Size = new
System.Drawing.Size(232, 56);
this.button1.TabIndex = 0;
this.button1.Text = "Hide Dialog";
this.toolTip1.SetToolTip
(this.button1, "ToolTop for Button");
this.button1.Click += new
System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new
System.Drawing.Size(5, 13);
this.ClientSize = new
System.Drawing.Size(264, 70);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Modal Dialog";
this.ResumeLayout(false);
}
[STAThread]
static void Main()
{
Form f = new Form1();
// First Show
// button1 has tooltip.
f.ShowDialog();
// Second Show ( after Hide )
// tooltip for button1 disappears.
f.ShowDialog();
}
private void button1_Click(object sender,
System.EventArgs e)
{
this.Hide();
this.button1.Text = "Were is my
tooltip?";
}
}
Thanks Edward.
In my application I have modal form and controls on this
form have tooltips. I do not recreate instance of the
form, only hide it and show again. But after second
ShowModal all tooltips disapear. Is this known bug, or I
do something wrong?
Sample code illustrates this behavior:
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button
button1;
private System.Windows.Forms.ToolTip
toolTip1;
public Form1()
{
this.button1 = new
System.Windows.Forms.Button();
this.toolTip1 = new
System.Windows.Forms.ToolTip();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new
System.Drawing.Point(16, 8);
this.button1.Name = "button1";
this.button1.Size = new
System.Drawing.Size(232, 56);
this.button1.TabIndex = 0;
this.button1.Text = "Hide Dialog";
this.toolTip1.SetToolTip
(this.button1, "ToolTop for Button");
this.button1.Click += new
System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new
System.Drawing.Size(5, 13);
this.ClientSize = new
System.Drawing.Size(264, 70);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Modal Dialog";
this.ResumeLayout(false);
}
[STAThread]
static void Main()
{
Form f = new Form1();
// First Show
// button1 has tooltip.
f.ShowDialog();
// Second Show ( after Hide )
// tooltip for button1 disappears.
f.ShowDialog();
}
private void button1_Click(object sender,
System.EventArgs e)
{
this.Hide();
this.button1.Text = "Were is my
tooltip?";
}
}
Thanks Edward.