Problem with moving picturebox with Cursor on Mouse_Move event.
-
Hi buddies, There are lots of small size picturebox on one picturebox control says picMain.At a time, I am moving only 1 picture on picMain on Mouse_Move event. But,I see problem with moving picture. Moving picture gets blur or I can say It need some re-draw. so,I have use Invalidate() and update() to make the solutions but not getting any solution. Instead of picMain if I try same thing on form, then it work very smoothly.I think picture box take more time to re-draw compare to form. Pls help !!!:confused:
Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
-
Hi buddies, There are lots of small size picturebox on one picturebox control says picMain.At a time, I am moving only 1 picture on picMain on Mouse_Move event. But,I see problem with moving picture. Moving picture gets blur or I can say It need some re-draw. so,I have use Invalidate() and update() to make the solutions but not getting any solution. Instead of picMain if I try same thing on form, then it work very smoothly.I think picture box take more time to re-draw compare to form. Pls help !!!:confused:
Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
I'm not sure what help you need. You've worked out the answer I would give, don't use pictureboxes, pretty much ever. Just draw the image yourself.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Hi buddies, There are lots of small size picturebox on one picturebox control says picMain.At a time, I am moving only 1 picture on picMain on Mouse_Move event. But,I see problem with moving picture. Moving picture gets blur or I can say It need some re-draw. so,I have use Invalidate() and update() to make the solutions but not getting any solution. Instead of picMain if I try same thing on form, then it work very smoothly.I think picture box take more time to re-draw compare to form. Pls help !!!:confused:
Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
You have alredy post that question, a few day ago...... if i am not wrong.... Your Same Post.....[^] and my answer was... Private dragging As Boolean Private beginX, beginY As Integer Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown dragging = True beginX = e.X beginY = e.Y End Sub Private Sub PictureBox1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp dragging = False End Sub Private Sub PictureBox1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove If dragging = True Then PictureBox1.Location = New Point(PictureBox1.Location.X + e.X - beginX, PictureBox1.Location.Y + e.Y - beginY) Me.Refresh() End If End Sub :laugh::laugh:
Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"
-
I'm not sure what help you need. You've worked out the answer I would give, don't use pictureboxes, pretty much ever. Just draw the image yourself.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Hi Mr Graus. My work is working fine only when child picture boxes are on form control, but now as my requirement got change, I have to move every child picturebox on picture box ctrl ( instead of form control ). When i move the child picturebox on picture control from xy1 location to xy2 location then picture looks like blur ( it seems that its own ghost is following at each mouse_move event).I am not getting the smotheness in dragging just as we get in Visual studio in design time during dragging ctrl from toolbox. pls reply thx
Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)