Provides data for the ToolTip.Draw event.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Thetype exposes the following members.
|AssociatedControl||Gets the control for which the ToolTip is being drawn.|
|AssociatedWindow||Gets the window to which this ToolTip is bound.|
|Bounds||Gets the size and location of the ToolTip to draw.|
|Font||Gets the font used to draw the ToolTip.|
|Graphics||Gets the graphics surface used to draw the ToolTip.|
|ToolTipText||Gets the text for the ToolTip that is being drawn.|
|DrawBackground||Draws the background of the ToolTip using the system background color.|
|DrawBorder||Draws the border of the ToolTip using the system border color.|
|DrawText()||Draws the text of the ToolTip using the system text color and font.|
|DrawText(TextFormatFlags)||Draws the text of the ToolTip using the system text color and font, and the specified text layout.|
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Serves as the default hash function. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
The ToolTip.Draw event is raised by the ToolTip class when the ToolTip is drawn and the ToolTip.OwnerDraw property value is true. The handler for this event receives a parameter of type . The class contains all the information needed to paint the ToolTip, including the ToolTip text, the Rectangle, and the Graphics object on which the drawing should be done. To customize the look of the ToolTip, use the Rectangle to determine the bounds of the ToolTip, and the Graphics object to perform your customized drawing. You can increase the bounds of the ToolTip before it is shown by handling the Popup event.
also supports partial customization through the DrawBackground, DrawText and DrawBorder methods. Using these methods, you can owner draw portions of the ToolTip while leaving the other portions drawn in the standard way.
The following code example demonstrates how to custom draw the ToolTip. The example creates a ToolTip and associates it to three Button controls located on the Form. The example sets the OwnerDraw property to true and handles the Draw event. In the Draw event handler, the ToolTip is custom drawn differently depending on what button the ToolTip is being displayed for as indicated by the DrawToolTipEventArgs.AssociatedControl property.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.