1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Public Class MonToggleBouton
Inherits CheckBox
Protected Overrides Sub Onpaint(Pevent As System.Windows.Forms.PaintEventArgs)
Pevent.Graphics.Clear(Me.BackColor)
If Me.Checked Then
Pevent.Graphics.DrawImage(My.Resources._ON, 0, 0)
Else
Pevent.Graphics.DrawImage(My.Resources._OFF, 0, 0)
End If
End Sub
Public Sub New()
Me.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.FlatAppearance.BorderSize = 0
Me.AutoSize = False
Me.Height = 160
Me.Width = 60
End Sub
End Class |