System.Windows.Forms.ToolTip.Show C# (CSharp) Méthode

Show() public méthode

public Show ( string text, IWin32Window window, int duration ) : void
text string
window IWin32Window
duration int
Résultat void
		public void Show (string text, IWin32Window window, 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;

			//XplatUI.SetOwner (tooltip_window.Handle, c.TopLevelControl.Handle);
			
			// If the mouse is in the requested window, use that position
			// Else, center in the requested window
			if (c.ClientRectangle.Contains (c.PointToClient (Control.MousePosition))) {
				tooltip_window.Location = Control.MousePosition;
				tooltip_strings[c] = text;
				HookupControlEvents (c);
			}
			else
				tooltip_window.Location = c.PointToScreen (new Point (c.Width / 2, c.Height / 2));
			
			// We need to hide our tooltip if the form loses focus, is closed, or is minimized
			HookupFormEvents ((Form)c.TopLevelControl);
			
			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, Point point, 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