Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Attach to Paint event
AddHandler myButton.Paint, AddressOf DrawButton
End Sub
'Handle the event
Private Sub DrawButton(ByVal sender As Object, ByVal e As PaintEventArgs)
'Draw cross
e.Graphics.DrawLine(Pens.Red, 0, 0, myButton.ClientRectangle.Width, myButton.ClientRectangle.Height)
e.Graphics.DrawLine(Pens.Red, myButton.ClientRectangle.Width, 0, 0, myButton.ClientRectangle.Height)
'Dispose not required
End Sub