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
    类型:System.Boolean
    执行的true 等待绘制请求;否则, false。

备注

,当调整形状的多个属性时, SuspendPaint 和 ResumePaint 方法一前一后用于禁止显示多个 Paint 事件。 例如,通常可以调用 SuspendPaint 方法,将形状的 BorderColorBorderStyle 属性,然后调用 ResumePaint 方法使更改生效。

示例

下面的示例演示如何为 OvalShape 控件使用 SuspendPaint 和 ResumePaint 方法。 此示例要求您具有名为在窗体的 OvalShape1 的一个 OvalShape 控件。

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)