StormyChan
New member
- Joined
- May 31, 2014
- Messages
- 2
- Programming Experience
- 1-3
Hello everyone.
i am working on a application. i need some help figuring out a problem i have with one of the features:
i use Visual Basic express 2010
what the feature should do:
i have 1 panel in the form that want the user to be able to move the panel along the location.X
by now i have this code:
Controls in form:
1 Panel called: MoveArea
1 Timer called: Timer1
what this code allready do is:
you can click the panel and move it around freely in the form. but i want it to only move the X location of the panel.
sins there are no "MouseRight" Event it have to be an other way around.
What do i need to change to make this work??
Please help me out.
-Stormy
i am working on a application. i need some help figuring out a problem i have with one of the features:
i use Visual Basic express 2010
what the feature should do:
i have 1 panel in the form that want the user to be able to move the panel along the location.X
by now i have this code:
Dim MoveBox, Curlocation As New Point(0, 0)
Private Sub sync()
MoveBox = MoveArea.Location
Curlocation = Cursor.Position
End Sub
Private Sub MoveArea_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MoveArea.Click
End Sub
Private Sub MoveArea_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MoveArea.MouseDown
Timer1.Enabled = True
Timer1.Start()
sync()
End Sub
Private Sub MoveArea_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MoveArea.MouseUp
Timer1.Stop()
sync()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
MoveArea.Location = MoveBox - Curlocation + Cursor.Position
End Sub
Controls in form:
1 Panel called: MoveArea
1 Timer called: Timer1
what this code allready do is:
you can click the panel and move it around freely in the form. but i want it to only move the X location of the panel.
sins there are no "MouseRight" Event it have to be an other way around.
What do i need to change to make this work??
Please help me out.
-Stormy
Last edited by a moderator: