共用方式為


Shape.ResumePaint 方法

繼續平常的繪製邏輯,選擇是否強制暫止中的繪製要求進行立即配置。

命名空間:  Microsoft.VisualBasic.PowerPacks
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

'宣告
Public Sub ResumePaint ( _
    performPaint As Boolean _
)
public void ResumePaint(
    bool performPaint
)
public:
void ResumePaint(
    bool performPaint
)
member ResumePaint : 
        performPaint:bool -> unit
public function ResumePaint(
    performPaint : boolean
)

參數

  • performPaint
    類型:Boolean

    true若要執行的要求擱置中的 [小畫家],否則, false。

備註

SuspendPaint和ResumePaint方法可用於使用串聯方式隱藏多個Paint時您正在調整圖形的多個屬性的事件。 例如,您通常會呼叫SuspendPaint方法,設定BorderColorBorderStyle的圖形,然後呼叫屬性ResumePaint方法,讓變更生效。

範例

下列範例示範如何使用SuspendPaint和ResumePaint方法OvalShape控制項。 此範例中您需要OvalShape名 OvalShape1 為表單上的控制項。

Private Sub OvalShape1_Click() Handles OvalShape1.Click
    ' Suspend painting.
    OvalShape1.SuspendPaint()
    ' Set some properties.
    OvalShape1.BackStyle = PowerPacks.BackStyle.Opaque
    OvalShape1.BackColor = Color.Blue
    OvalShape1.FillStyle = PowerPacks.FillStyle.Plaid
    OvalShape1.FillColor = Color.Red
    ' Resume painting and execute any pending requests.
    OvalShape1.ResumePaint(True)
End Sub
private void ovalShape1_Click(System.Object sender, System.EventArgs e)
{
    // Suspend painting.
    ovalShape1.SuspendPaint();
    // Set some properties.
    ovalShape1.BackStyle = BackStyle.Opaque;
    ovalShape1.BackColor = Color.Blue;
    ovalShape1.FillStyle = FillStyle.Plaid;
    ovalShape1.FillColor = Color.Red;
    // Resume painting and execute any pending requests.
    ovalShape1.ResumePaint(true);
}

.NET Framework 安全性

請參閱

參考

Shape 類別

Microsoft.VisualBasic.PowerPacks 命名空間

其他資源

如何:使用 LineShape 控制項繪製線條 (Visual Studio)

如何:使用 OvalShape 和 RectangleShape 控制項繪製圖案 (Visual Studio)

Line 和 Shape 控制項簡介 (Visual Studio)