System.Windows.Forms.ToolTip.Show C# (CSharp) Method

Show() public method

public Show ( string text, IWin32Window window, Point point, int duration ) : void
text string
window IWin32Window
point Point
duration int
return void
		public void Show (string text, IWin32Window window, Point point, int duration)
		{
			if (window == null)
				throw new ArgumentNullException ("window");
			if (duration < 0)
				throw new ArgumentOutOfRangeException ("duration", "duration cannot be less than zero");

			if (!Active)
				return;

			timer.Stop ();

			Control c = (Control)window;
			
			Point display_point = c.PointToScreen (Point.Empty);
			display_point.X += point.X;
			display_point.Y += point.Y;

			//XplatUI.SetOwner (tooltip_window.Handle, c.TopLevelControl.Handle);

			// We need to hide our tooltip if the form loses focus, is closed, or is minimized
			HookupFormEvents ((Form)c.TopLevelControl);

			tooltip_window.Location = display_point;
			tooltip_window.PresentModal ((Control)window, text);

			state = TipState.Show;
			
			if (duration > 0) {
				timer.Interval = duration;
				timer.Start ();
			}
		}
		

Same methods

ToolTip::Show ( string text, IWin32Window window ) : void
ToolTip::Show ( string text, IWin32Window window, Point point ) : void
ToolTip::Show ( string text, IWin32Window window, int duration ) : void
ToolTip::Show ( string text, IWin32Window window, int x, int y ) : void
ToolTip::Show ( string text, IWin32Window window, int x, int y, int duration ) : void

Usage Example

 private void textBoxEnd_MouseHover(object sender, EventArgs e)
 {
     myToolTip.Show("Enter a period value to end at.", textBoxEnd, 3000);
 }
All Usage Examples Of System.Windows.Forms.ToolTip::Show