الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Move PictureBox: picture control with mouse

بدأه محمد مسافر في 19 نوفمبر 2014 · 5 رد · 1,960 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بسم الله الرحمن الرحيم

اريد المساعدة في الحصول على كود تحريك الصورة كما هو موضح في الصورة حصلت على الكود الخاص بالتكبير بقي كودpost-277276-0-41127000-1416386389_thumb. تحريك الصورة 

كود التكبير ضعه في بوتون

PictureBox1.Width += 40% 
PictureBox1.Height += 40%

تم تعديل هذه المشاركة بواسطة محمد مسافر في 19 نوفمبر 2014 في 11:42

#2

السلام عليكم

 

جرب الكود التالي

 

 

 

 

Dim TemporaryMousePointerLocation 
As Point 
Private 
Sub 
PictureBox1_MouseMove(ByVal sender As Object, 
ByVal e As System.Windows.Forms.MouseEventArgs) 
Handles 
PictureBox1.MouseMove
 Static 
UpdateMouseOnNextMove As 
Boolean = False 
If 
DirectCast(e, MouseEventArgs).Button = MouseButtons.Right Then 
If 
UpdateMouseOnNextMove Then 

PictureBox1.Left 
-= (Windows.Forms.Cursor.Position.X - TemporaryMousePointerLocation.X) 
PictureBox1.Top 
-= (Windows.Forms.Cursor.Position.Y - TemporaryMousePointerLocation.Y) 
Windows.Forms.Cursor.Position 
= 
TemporaryMousePointerLocation UpdateMouseOnNextMove = False 
Else 

UpdateMouseOnNextMove = True ' allow cursor to move a bit so we can 
update the position of the mouse
 End If 
Else 
TemporaryMousePointerLocation = Windows.Forms.Cursor.Position 
End 
If 
End Sub
#3

اداة تنسيق الكود لا تعمل بالشكل المطلوب .. فعذراً

#4

تفضل اخي مثال و لكن بكود مختلف

 

 

بالتوفيق

#5

تفضل اخي مثال و لكن بكود مختلف

 

 

بالتوفيق

movePictureBox.rar

#6

وجدت الحل وشكراً للجميع ولمن ساعدني ولم يتجاهل موضوعي

 

 Private Sub PictureBox_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
        Static mousePosX 
As Single, mousePosY As Single
        If e
.Button = 0 Then
            mousePosX 
= e.X
            mousePosY 
= e.Y
        Else
            PictureBox1
.Left = PictureBox1.Left + (e.X - mousePosX)
 
           PictureBox1.Top = PictureBox1.Top + (e.Y - mousePosY)
 
       End If
 
   End Sub

 

 

 

 

وهذاء مشروع ممكن الاستفادة منة

Manual PictureBox Zoom - 01.zip

مواضيع مشابهة