共用方式為


ToolStripArrowRenderEventArgs.Graphics 屬性

定義

取得繪製 ToolStrip 箭號所用的圖形。

public:
 property System::Drawing::Graphics ^ Graphics { System::Drawing::Graphics ^ get(); };
public System.Drawing.Graphics Graphics { get; }
member this.Graphics : System.Drawing.Graphics
Public ReadOnly Property Graphics As Graphics

屬性值

用來繪製的 Graphics

範例

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

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

private void ToolStripRenderer1_RenderArrow(Object sender, ToolStripArrowRenderEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ArrowRectangle", e.ArrowRectangle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ArrowColor", e.ArrowColor );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Direction", e.Direction );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Item", e.Item );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RenderArrow Event" );
}
Private Sub ToolStripRenderer1_RenderArrow(sender as Object, e as ToolStripArrowRenderEventArgs) _ 
     Handles ToolStripRenderer1.RenderArrow

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "ArrowRectangle", e.ArrowRectangle)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ArrowColor", e.ArrowColor)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Direction", e.Direction)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Graphics", e.Graphics)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Item", e.Item)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"RenderArrow Event")

End Sub

適用於