Monday, February 14, 2011

in this post i will Show how manipulate events on a button

These lines of code will change the location of the button.

Public Class Form1Dim var As Integer 

var += 1
LblCounter.Text = var
Private Sub form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ClickEnd Sub



Private Sub button1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseEnterDim p1 As New Point(52, 214) 'changes the point of the button when the mouuse is entered Dim p2 As New Point(227, 10)If Button1.Location = p1 Then  'if the buttons location doesnt equal the 1st point then the second locations is enabledButton1.Location = p2
ElseButton1.Location = p1 ' (Else If) the point goes back to the 1st point
End If 
 

End
End Sub Class

No comments:

Post a Comment