Skip to content

Commit

Permalink
2007-08-10 Jonathan Pobst <monkey@jpobst.com>
Browse files Browse the repository at this point in the history
	[Backport of r83821]
	* ToolTip.cs: Hide the tooltip if the control is clicked to match MS behavior.
	[Fixes bug #82348]

svn path=/branches/mono-1-2-5/mcs/; revision=83823
  • Loading branch information
jpobst committed Aug 10, 2007
1 parent 04c3bba commit 6e04ed5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
@@ -1,3 +1,8 @@
2007-08-10 Jonathan Pobst <monkey@jpobst.com>
[Backport of r83821]
* ToolTip.cs: Hide the tooltip if the control is clicked to match MS behavior.
[Fixes bug #82348]

2007-08-02 Rolf Bjarne Kvinge <RKvinge@novell.com>

[ Backport selected parts of r82743, fixes #82234]
Expand Down
13 changes: 13 additions & 0 deletions mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs
Expand Up @@ -390,6 +390,7 @@ public string GetToolTip (Control control)
control.MouseEnter += new EventHandler(control_MouseEnter);
control.MouseMove += new MouseEventHandler(control_MouseMove);
control.MouseLeave += new EventHandler(control_MouseLeave);
control.MouseDown += new MouseEventHandler (control_MouseDown);
controls.Add(control);
}

Expand Down Expand Up @@ -549,6 +550,18 @@ private void control_MouseLeave(object sender, EventArgs e)
Hide (sender as Control);
}


void control_MouseDown (object sender, MouseEventArgs e)
{
timer.Stop();

active_control = null;
tooltip_window.Visible = false;

if (last_control == sender)
last_control = null;
}

private void Hide (Control sender)
{
timer.Stop();
Expand Down

0 comments on commit 6e04ed5

Please sign in to comment.