ToolStripPanelRenderEventArgs ToolStripPanelRenderEventArgs ToolStripPanelRenderEventArgs ToolStripPanelRenderEventArgs Class


Provides data for ToolStripPanel drawing.

public ref class ToolStripPanelRenderEventArgs : EventArgs
public class ToolStripPanelRenderEventArgs : EventArgs
type ToolStripPanelRenderEventArgs = class
    inherit EventArgs
Public Class ToolStripPanelRenderEventArgs
Inherits EventArgs


The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the RenderToolStripPanelBackground event. This report helps you to learn when the event occurs and can assist you in debugging.

To run the example code, paste it into a project that contains an instance of a type that inherits from ToolStripRenderer, such as a ToolStripSystemRenderer or ToolStripProfessionalRenderer. Then name the instance ToolStripRenderer1 and ensure that the event handler is associated with the RenderToolStripPanelBackground event.

private void ToolStripRenderer1_RenderToolStripPanelBackground(Object sender, ToolStripPanelRenderEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendFormat("{0} = {1}", "ToolStripPanel", e.ToolStripPanel );
messageBoxCS.AppendFormat("{0} = {1}", "Handled", e.Handled );
MessageBox.Show(messageBoxCS.ToString(), "RenderToolStripPanelBackground Event" );
Private Sub ToolStripRenderer1_RenderToolStripPanelBackground(sender as Object, e as ToolStripPanelRenderEventArgs) _ 
     Handles ToolStripRenderer1.RenderToolStripPanelBackground

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Graphics", e.Graphics)
    messageBoxVB.AppendFormat("{0} = {1}", "ToolStripPanel", e.ToolStripPanel)
    messageBoxVB.AppendFormat("{0} = {1}", "Handled", e.Handled)
    MessageBox.Show(messageBoxVB.ToString(),"RenderToolStripPanelBackground Event")

End Sub


ToolStripPanelRenderEventArgs(Graphics, ToolStripPanel) ToolStripPanelRenderEventArgs(Graphics, ToolStripPanel) ToolStripPanelRenderEventArgs(Graphics, ToolStripPanel) ToolStripPanelRenderEventArgs(Graphics, ToolStripPanel)

Initializes a new instance of the ToolStripPanelRenderEventArgs class for the specified ToolStripPanel that uses the specified graphics for drawing.


Graphics Graphics Graphics Graphics

Gets or sets the graphics used to paint the ToolStripPanel.

Handled Handled Handled Handled

Gets or sets a value indicating whether the event was handled.

ToolStripPanel ToolStripPanel ToolStripPanel ToolStripPanel

Gets the ToolStripPanel to paint.


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