共用方式為


ToolStripRenderer.RenderItemCheck 事件

定義

發生於呈現已選取 ToolStripItem 的影像時。

public:
 event System::Windows::Forms::ToolStripItemImageRenderEventHandler ^ RenderItemCheck;
public event System.Windows.Forms.ToolStripItemImageRenderEventHandler RenderItemCheck;
member this.RenderItemCheck : System.Windows.Forms.ToolStripItemImageRenderEventHandler 
Public Custom Event RenderItemCheck As ToolStripItemImageRenderEventHandler 

事件類型

範例

下列程式碼範例示範如何使用這個成員。 在此範例中,事件處理常式會報告事件的發生次數 RenderItemCheck 。 此報告可協助您瞭解事件發生的時間,並可協助您進行偵錯。

若要執行範例程式碼,請將它貼入包含繼承自 ToolStripRenderer 之型別實例的專案,例如 ToolStripSystemRendererToolStripProfessionalRenderer 。 然後命名 實例 ToolStripRenderer1 ,並確定事件處理常式與 事件相關聯 RenderItemCheck

private void ToolStripRenderer1_RenderItemCheck(Object sender, ToolStripItemImageRenderEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Image", e.Image );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ImageRectangle", e.ImageRectangle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Item", e.Item );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ToolStrip", e.ToolStrip );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RenderItemCheck Event" );
}
Private Sub ToolStripRenderer1_RenderItemCheck(sender as Object, e as ToolStripItemImageRenderEventArgs) _ 
     Handles ToolStripRenderer1.RenderItemCheck

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Image", e.Image)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ImageRectangle", e.ImageRectangle)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Graphics", e.Graphics)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Item", e.Item)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ToolStrip", e.ToolStrip)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"RenderItemCheck Event")

End Sub

備註

如需處理事件的詳細資訊,請參閱 處理和引發事件

適用於