[VB 2005]PictureBox.Location

Arster-Boy

Erfahrenes Mitglied
Hallo,
wenn man auf einen Button klickt soll die Location der PictureBox1 verändert werden.
Nur wie muss man die Location aufschreiben?
Das habe ich schon geschrieben:
Code:
PictureBox1.Location =

Danke!
 
Du erstellst dir zuerst globale Variablen:
Code:
Public x As Integer = 0, y As Integer = 0

Und bei einem Buttonklick, verändert sich die Location immer ein bisschen:
Code:
Private Sub button_Click(ByVal sender As Object, ByVal e As EventArgs)     
    x += 25 
    y += 25 
    Picturebox1.Location = New Point(x, y) 
End Sub
 
Zurück