ToolStripRenderEventArgs Class

Definition

public ref class ToolStripRenderEventArgs : EventArgs
public class ToolStripRenderEventArgs : EventArgs
type ToolStripRenderEventArgs = class
    inherit EventArgs
Public Class ToolStripRenderEventArgs
Inherits EventArgs
Inheritance
ToolStripRenderEventArgs
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, 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.

ToolStripRenderEventArgs(Graphics, ToolStrip)

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

Properties

AffectedBounds

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

BackColor

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

ConnectedArea

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

Graphics

Gets the Graphics used to paint.

ToolStrip

Gets the ToolStrip to be painted.

Methods

Equals(Object)

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

(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)

Applies to

See also