Bewerken

Share via


ToolStripPanelRenderEventArgs Class

Definition

Provides data for ToolStripPanel drawing.

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

Examples

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.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ToolStripPanel", e.ToolStripPanel );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Handled", e.Handled );
messageBoxCS.AppendLine();
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.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ToolStripPanel", e.ToolStripPanel)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Handled", e.Handled)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"RenderToolStripPanelBackground Event")

End Sub

Constructors

ToolStripPanelRenderEventArgs(Graphics, ToolStripPanel)

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

Properties

Graphics

Gets or sets the graphics used to paint the ToolStripPanel.

Handled

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

ToolStripPanel

Gets the ToolStripPanel to paint.

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