movable image inside a form in vb2008
Post your questions regarding programming in Visual Basic 6 in here.
4 posts
Page 1 of 1
how i can put a movable image inside a form in vb 2008
is this possible or not if possible please teach me how
tnx.......
is this possible or not if possible please teach me how
tnx.......
You mean, something you can resize (like in Paint)?
Try this:
That allows you to move a panel (Panel1) everywhere inside your form, with that I'm pretty sure you can figure out how to move a PictureBox with an Image inside...
Try this:
Code: Select all
Made by: nobugz Private mMousePos As Point
Private mPanelPos As Point
Private mDragging As Boolean
Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
mDragging = True
mMousePos = Me.Panel1.PointToScreen(e.Location)
mPanelPos = Me.Panel1.Location
End Sub
Private Sub Panel1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp
mDragging = False
End Sub
Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
If Not mDragging Then Exit Sub
Dim pos As Point = Me.Panel1.PointToScreen(e.Location)
Me.Panel1.Left = mPanelPos.X + pos.X - mMousePos.X
Me.Panel1.Top = mPanelPos.Y + pos.Y - mMousePos.Y
End Sub
That allows you to move a panel (Panel1) everywhere inside your form, with that I'm pretty sure you can figure out how to move a PictureBox with an Image inside...
Ok no problem, Glad it worked. Good luck with your project.
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023