تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
(تم الحل) تحريك الادوات
#4
السلام عليكم،
تم التعديل على الكود ليعمل كما تريد
الكود بعد التعديل:
كود :
Public Class Form1
    Public Const WM_NCLBUTTONDOWN = &HA1
    Public Const HTCAPTION = 2

    Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
        If e.Button = Windows.Forms.MouseButtons.Left Then
            Button1.Capture = False
            Dim msg As Message = _
                Message.Create(Button1.Handle, WM_NCLBUTTONDOWN, _
                    New IntPtr(HTCAPTION), IntPtr.Zero)
            Me.DefWndProc(msg)
        End If
        Me.Button1.BackColor = Color.Violet
    End Sub

    Private Sub Button2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button2.MouseDown
        If e.Button = Windows.Forms.MouseButtons.Left Then
            Button2.Capture = False
            Dim msg As Message = _
                Message.Create(Button2.Handle, WM_NCLBUTTONDOWN, _
                    New IntPtr(HTCAPTION), IntPtr.Zero)
            Me.DefWndProc(msg)
        End If

        Me.Button2.BackColor = Color.Violet

    End Sub

    Private Sub Button3_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button3.MouseDown
        If e.Button = Windows.Forms.MouseButtons.Left Then
            Button3.Capture = False
            Dim msg As Message = _
                Message.Create(Button3.Handle, WM_NCLBUTTONDOWN, _
                    New IntPtr(HTCAPTION), IntPtr.Zero)
            Me.DefWndProc(msg)
        End If

        Me.Button3.BackColor = Color.Violet

    End Sub

    Private Sub Button4_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button4.MouseDown
        If e.Button = Windows.Forms.MouseButtons.Left Then
            Button4.Capture = False
            Dim msg As Message = _
                Message.Create(Button4.Handle, WM_NCLBUTTONDOWN, _
                    New IntPtr(HTCAPTION), IntPtr.Zero)
            Me.DefWndProc(msg)
        End If

        Me.Button4.BackColor = Color.Violet

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

        Me.Button1.Location = New System.Drawing.Point(149, 66)
        Me.Button2.Location = New System.Drawing.Point(12, 66)
        Me.Button3.Location = New System.Drawing.Point(12, 24)
        Me.Button4.Location = New System.Drawing.Point(149, 24)

        Me.Button1.BackColor = Color.Empty
        Me.Button2.BackColor = Color.Empty
        Me.Button3.BackColor = Color.Empty
        Me.Button4.BackColor = Color.Empty

    End Sub

    Private Sub TextBox2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox2.MouseDown
        If Me.Button1.BackColor = Color.Violet Then
            Me.Button1.Location = New System.Drawing.Point(12, 132)
            If Me.Button1.Location = New System.Drawing.Point(12, 132) Then
                Me.Button1.BackColor = Color.Empty
                MsgBox("صح")
                TextBox2.Location = New Point(Button1.Left, Button1.Top - Button1.Height)
            End If
        End If
        If Me.Button2.BackColor = Color.Violet Then
            Me.Button2.Location = New System.Drawing.Point(12, 132)
            If Me.Button2.Location = New System.Drawing.Point(12, 132) Then
                Me.Button2.BackColor = Color.Empty
                MsgBox("خطأ")
                TextBox2.Location = New Point(Button2.Left, Button2.Top - Button2.Height)
            End If
        End If
        If Me.Button3.BackColor = Color.Violet Then
            Me.Button3.Location = New System.Drawing.Point(12, 132)
            If Me.Button3.Location = New System.Drawing.Point(12, 132) Then
                Me.Button3.BackColor = Color.Empty
                MsgBox("خطأ")
                TextBox2.Location = New Point(Button3.Left, Button3.Top - Button3.Height)
            End If
        End If
        If Me.Button4.BackColor = Color.Violet Then
            Me.Button4.Location = New System.Drawing.Point(12, 132)
            If Me.Button4.Location = New System.Drawing.Point(12, 132) Then
                Me.Button4.BackColor = Color.Empty
                MsgBox("خطأ")
                TextBox2.Location = New Point(Button4.Left, Button4.Top - Button4.Height)
            End If
        End If
    End Sub

    Private Sub TextBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown
        If Me.Button1.BackColor = Color.Violet Then
            Me.Button1.Location = New System.Drawing.Point(149, 132)
            If Me.Button1.Location = New System.Drawing.Point(149, 132) Then
                Me.Button1.BackColor = Color.Empty
                MsgBox("خطأ")
                TextBox1.Location = New Point(Button1.Left, Button1.Top - Button1.Height)
            End If
        End If
        If Me.Button2.BackColor = Color.Violet Then
            Me.Button2.Location = New System.Drawing.Point(149, 132)
            If Me.Button2.Location = New System.Drawing.Point(149, 132) Then
                Me.Button2.BackColor = Color.Empty
                MsgBox("صح")
                TextBox1.Location = New Point(Button2.Left, Button2.Top - Button2.Height)
            End If
        End If
        If Me.Button3.BackColor = Color.Violet Then
            Me.Button3.Location = New System.Drawing.Point(149, 132)
            If Me.Button3.Location = New System.Drawing.Point(149, 132) Then
                Me.Button3.BackColor = Color.Empty
                MsgBox("خطأ")
                TextBox1.Location = New Point(Button3.Left, Button3.Top - Button3.Height)
            End If
        End If
        If Me.Button4.BackColor = Color.Violet Then
            Me.Button4.Location = New System.Drawing.Point(149, 132)
            If Me.Button4.Location = New System.Drawing.Point(149, 132) Then
                Me.Button4.BackColor = Color.Empty
                MsgBox("خطأ")
                TextBox1.Location = New Point(Button4.Left, Button4.Top - Button4.Height)
            End If
        End If
    End Sub
End Class
}}}
تم الشكر بواسطة:


الردود في هذا الموضوع
(تم الحل) تحريك الادوات - بواسطة aftfm - 13-11-12, 10:54 PM
(تم الحل) تحريك الادوات - بواسطة سعود - 13-11-12, 11:27 PM
(تم الحل) تحريك الادوات - بواسطة aftfm - 14-11-12, 09:42 AM
(تم الحل) تحريك الادوات - بواسطة Aly El-Haddad_mybb_import4475 - 14-11-12, 03:21 PM
(تم الحل) تحريك الادوات - بواسطة DreamsDotNet - 14-11-12, 05:18 PM
(تم الحل) تحريك الادوات - بواسطة aftfm - 15-11-12, 01:28 AM
(تم الحل) تحريك الادوات - بواسطة Osama_Ghareeb - 15-11-12, 02:36 PM
(تم الحل) تحريك الادوات - بواسطة aftfm - 15-11-12, 03:15 PM
(تم الحل) تحريك الادوات - بواسطة aftfm - 16-11-12, 03:39 PM
(تم الحل) تحريك الادوات - بواسطة Osama_Ghareeb - 17-11-12, 01:09 AM
(تم الحل) تحريك الادوات - بواسطة aftfm - 17-11-12, 07:25 AM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  كيف يمكن تحريك الفورم بأستخدام زر heem1986 2 591 30-03-25, 01:58 AM
آخر رد: heem1986
  ما الحل dwidar07@gmail.com 3 432 21-02-25, 01:08 AM
آخر رد: أبو خالد الشكري
  سؤال في تحريك التحديد في datagrideview maher_haddaf 3 755 23-10-23, 08:27 AM
آخر رد: أبو خالد الشكري
  البرنامج لدي يعمل على ويندوز 11 والان لا يعمل على ويندوز 10 ماهو الحل moh61 1 592 01-09-23, 04:38 AM
آخر رد: اسامه الهرماوي
  ممكن الحل masport tv 0 504 07-04-23, 11:36 AM
آخر رد: masport tv
  كود تحريك الادوات داخل الفورم مع حفظ الترتيب حماده ممدوح البحيرى 0 477 17-12-22, 02:11 PM
آخر رد: حماده ممدوح البحيرى
  مطلوب كود تكبير الفورم مع الحفاظ علي حجم ومكان الادوات عند التكبير والتصغير Mostafa201255411 1 1,156 12-12-22, 07:02 PM
آخر رد: Taha Okla
  ارجو ان لا تبخلو علينا با الحل ahmedbezia 3 724 06-12-22, 01:29 PM
آخر رد: ahmedbezia
  [سؤال] [تم الحل] انشاء المسارات وتمرير البارامترات لها وقت التشغيل سعود 7 1,727 03-09-22, 09:44 AM
آخر رد: Taha Okla
  مشكلة واجهتني كتير وزهقت منها فاللي عنده الحل ياريت يفيدني بيه ميدو الفنان 7 1,537 03-09-22, 03:33 AM
آخر رد: ميدو الفنان

التنقل السريع :


يقوم بقرائة الموضوع: