Questo:
NON E' l'evento click del pulsante. Questo invece sì:codice:Private Sub Button5_Click(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Variabile globale:codice:Private Sub Button5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.Click
Evento click:codice:Public Colore As Color = Color.Blue
Evento paint:codice:Private Sub Button5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.Click Colore = Color.Red End Sub
codice:Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint e.Graphics.FillRectangle(New SolidBrush(Colore), New RectangleF(100, 100, 100, 100)) End Sub

Rispondi quotando