本文整理汇总了VB.NET中System.Windows.Forms.ControlPaint类的典型用法代码示例。如果您正苦于以下问题:VB.NET ControlPaint类的具体用法?VB.NET ControlPaint怎么用?VB.NET ControlPaint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ControlPaint类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Main
' 导入命名空间
Imports System.Drawing
Imports System.Windows.Forms
Public Class Form1
Inherits System.Windows.Forms.Form
Private button1 As System.Windows.Forms.Button = New Button
Private button2 As System.Windows.Forms.Button = New Button
<System.STAThreadAttribute()> _
Public Shared Sub Main()
System.Windows.Forms.Application.Run(New Form1)
End Sub
Public Sub New()
Me.button2.Location = New Point(0, button1.Height + 10)
AddHandler Me.button2.Click, AddressOf Me.button2_Click
Me.Controls.Add(Me.button1)
Me.Controls.Add(Me.button2)
End Sub
Private Sub button2_Click(sender As Object, e As System.EventArgs)
' Draws a flat button on button1.
ControlPaint.DrawButton(System.Drawing.Graphics.FromHwnd(button1.Handle), 0, 0, button1.Width, button1.Height, ButtonState.Flat)
End Sub
End Class