커스텀 버튼

교교 2014.01.23 08:07:56 *: Imports System.Drawing
Public Class Class1
Inherits Windows.Forms.Button

Public Sub New()
Me.Size = New Point(32, 32)
Me.FlatStyle = Windows.Forms.FlatStyle.Flat
Me.FlatAppearance.BorderSize = 0
Me.FlatAppearance.BorderColor = System.Drawing.Color.Aqua
Me.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Black
Me.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Blue
Me.BackColor = System.Drawing.Color.Transparent
Me.BackgroundImage = My.Resources.버튼
Me.BackgroundImageLayout = Windows.Forms.ImageLayout.Stretch
Me.Font = New System.Drawing.Font("tahma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
End Sub

Private Sub Class1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
Me.BackgroundImage = My.Resources.버튼2
End Sub

Private Sub Class1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseEnter
Me.BackgroundImage = My.Resources.버튼2
End Sub

Private Sub Class1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseLeave
Me.BackgroundImage = My.Resources.버튼3
End Sub

Private Sub Class1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
Me.BackgroundImage = My.Resources.버튼3
End Sub
End Class

 

http://www.tutorialspoint.com/vb.net/vb.net_button.htm