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

الرجاء تعديل الكود

بدأه مي جمال في 4 مارس 2011 · 2 رد · 396 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

الرجاء تعديل الكود

المشكلة هي اذا قمت بترتيب الصور بطريقة صحيحة او خاطئة

تظهر سالة حاول مرة اخرى

وششكرا

البرنامج في المرفقات

تركيب الكلمات.rar

#2

السلام عليكم

هذا الكود بعد التعديل

 Public Class Form1
    Dim PIC1 As Boolean = False
    Dim PIC2 As Boolean = False
    Dim PIC3 As Boolean = False
    Dim PIC4 As Boolean = False

    'عرف عن المتغير التالي
    Private start As New Point()
    'حدث التحريك
    Private Sub PictureBox6_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox6.MouseMove
        Dim p As PictureBox = sender
        If e.Button = MouseButtons.Left Then
            Dim mousePos As Point = Me.PointToClient(Control.MousePosition)
            If start.IsEmpty Then start = New Point(mousePos.X - p.Left, mousePos.Y - p.Top)
            p.Location = New Point(mousePos.X - start.X, mousePos.Y - start.Y)
        ElseIf Not start.IsEmpty Then
            start = New Point()
        End If
    End Sub
    Private Sub PictureBox7_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox7.MouseMove
        Dim p As PictureBox = sender
        If e.Button = MouseButtons.Left Then
            Dim mousePos As Point = Me.PointToClient(Control.MousePosition)
            If start.IsEmpty Then start = New Point(mousePos.X - p.Left, mousePos.Y - p.Top)
            p.Location = New Point(mousePos.X - start.X, mousePos.Y - start.Y)
        ElseIf Not start.IsEmpty Then
            start = New Point()
        End If
    End Sub
    Private Sub PictureBox8_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox8.MouseMove
        Dim p As PictureBox = sender
        If e.Button = MouseButtons.Left Then
            Dim mousePos As Point = Me.PointToClient(Control.MousePosition)
            If start.IsEmpty Then start = New Point(mousePos.X - p.Left, mousePos.Y - p.Top)
            p.Location = New Point(mousePos.X - start.X, mousePos.Y - start.Y)
        ElseIf Not start.IsEmpty Then
            start = New Point()
        End If
    End Sub
    Private Sub PictureBox9_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox9.MouseMove

        Dim p As PictureBox = sender
        If e.Button = MouseButtons.Left Then
            Dim mousePos As Point = Me.PointToClient(Control.MousePosition)
            If start.IsEmpty Then start = New Point(mousePos.X - p.Left, mousePos.Y - p.Top)
            p.Location = New Point(mousePos.X - start.X, mousePos.Y - start.Y)
        ElseIf Not start.IsEmpty Then
            start = New Point()
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If PictureBox6.Location.X > PictureBox8.Location.X And PictureBox6.Location.X < PictureBox7.Location.X And PictureBox6.Location.X < PictureBox9.Location.X Then
            PIC3 = True
        Else
            PIC3 = False
        End If
        If PictureBox7.Location.X > PictureBox6.Location.X And PictureBox7.Location.X > PictureBox8.Location.X And PictureBox7.Location.X < PictureBox9.Location.X Then
            PIC2 = True
        Else
            PIC2 = False
        End If
        If PictureBox8.Location.X < PictureBox6.Location.X And PictureBox8.Location.X < PictureBox7.Location.X And PictureBox8.Location.X < PictureBox9.Location.X Then
            PIC4 = True
        Else
            PIC4 = False
        End If
        If PictureBox9.Location.X > PictureBox6.Location.X And PictureBox9.Location.X > PictureBox7.Location.X And PictureBox9.Location.X > PictureBox8.Location.X Then
            PIC1 = True
        Else
            PIC1 = False
        End If

        If PIC1 = True And PIC2 = True And PIC3 = True And PIC4 = True Then
            Label1.Text = "أحسنت"
        Else
            Label1.Text = "حاول مرة اخرى"

        End If


    End Sub



End Class

163374357.gif

#3

اشكرك جزيل الشكر

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