ToolStripRenderEventArgs ToolStripRenderEventArgs ToolStripRenderEventArgs ToolStripRenderEventArgs Class

Definition

public ref class ToolStripRenderEventArgs : EventArgs
public class ToolStripRenderEventArgs : EventArgs
type ToolStripRenderEventArgs = class
    inherit EventArgs
Public Class ToolStripRenderEventArgs
Inherits EventArgs
Inheritance
ToolStripRenderEventArgsToolStripRenderEventArgsToolStripRenderEventArgsToolStripRenderEventArgs
Derived

Examples

The following code example demonstrates how to override the OnRenderToolStripBorder method to draw a custom border around a ToolStrip control. This code example is part of a larger example provided for the ToolStripRenderer class.

// This method draws a border around the GridStrip control.
protected override void OnRenderToolStripBorder(
    ToolStripRenderEventArgs e)
{
    base.OnRenderToolStripBorder(e);

    ControlPaint.DrawFocusRectangle(
        e.Graphics,
        e.AffectedBounds,
        SystemColors.ControlDarkDark,
        SystemColors.ControlDarkDark);
}
' This method draws a border around the GridStrip control.
Protected Overrides Sub OnRenderToolStripBorder(e As ToolStripRenderEventArgs)
   MyBase.OnRenderToolStripBorder(e)
   
   ControlPaint.DrawFocusRectangle(e.Graphics, e.AffectedBounds, SystemColors.ControlDarkDark, SystemColors.ControlDarkDark)
End Sub 

Remarks

The ToolStripRenderEventArgs class also provides data for the DrawImageMargin, DrawToolStripBorder, and DrawToolStripBackground methods.

Constructors

ToolStripRenderEventArgs(Graphics, ToolStrip) ToolStripRenderEventArgs(Graphics, ToolStrip) ToolStripRenderEventArgs(Graphics, ToolStrip) ToolStripRenderEventArgs(Graphics, ToolStrip)

Initializes a new instance of the ToolStripRenderEventArgs class for the specified ToolStrip and using the specified Graphics.

ToolStripRenderEventArgs(Graphics, ToolStrip, Rectangle, Color) ToolStripRenderEventArgs(Graphics, ToolStrip, Rectangle, Color) ToolStripRenderEventArgs(Graphics, ToolStrip, Rectangle, Color) ToolStripRenderEventArgs(Graphics, ToolStrip, Rectangle, Color)

Initializes a new instance of the ToolStripRenderEventArgs class for the specified ToolStrip, using the specified Graphics to paint the specified bounds with the specified Color.

Properties

AffectedBounds AffectedBounds AffectedBounds AffectedBounds

Gets the Rectangle representing the bounds of the area to be painted.

BackColor BackColor BackColor BackColor

Gets the Color that the background of the ToolStrip is painted with.

ConnectedArea ConnectedArea ConnectedArea ConnectedArea

Gets the Rectangle representing the overlap area between a ToolStripDropDown and its OwnerItem.

Graphics Graphics Graphics Graphics

Gets the Graphics used to paint.

ToolStrip ToolStrip ToolStrip ToolStrip

Gets the ToolStrip to be painted.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also