Upraviť

Zdieľať cez


ToolStripContentPanelRenderEventArgs Class

Definition

Provides data for the RendererChanged event.

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

Examples

The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the RenderToolStripContentPanelBackground 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 RenderToolStripContentPanelBackground event.

private void ToolStripRenderer1_RenderToolStripContentPanelBackground(Object sender, ToolStripContentPanelRenderEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Handled", e.Handled );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ToolStripContentPanel", e.ToolStripContentPanel );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RenderToolStripContentPanelBackground Event" );
}
Private Sub ToolStripRenderer1_RenderToolStripContentPanelBackground(sender as Object, e as ToolStripContentPanelRenderEventArgs) _ 
     Handles ToolStripRenderer1.RenderToolStripContentPanelBackground

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

End Sub

Constructors

ToolStripContentPanelRenderEventArgs(Graphics, ToolStripContentPanel)

Initializes a new instance of the ToolStripContentPanelRenderEventArgs class.

Properties

Graphics

Gets the object to use for drawing.

Handled

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

ToolStripContentPanel

Gets the ToolStripContentPanel affected by the click.

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