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

شرح برنامج الcase

بدأه بشرى26 في 14 نوفمبر 2009 · 0 رد · 378 مشاهدة · في لغة Ms Visual Basic 6 وما قبلها من إصدارات
مشاركة: واتساب X فيسبوك تيليجرام
#1

السلام عليكم كيفكم

بصراحه انا عندي برنامج بالفيجوال بيسك 2005 مافهمته

وعندي امتحان واحد يساعدني

     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        lstCountryBox.Items.Add("England")

        lstCountryBox.Items.Add("Germany")

        lstCountryBox.Items.Add("Mexico")

        lstCountryBox.Items.Add("Italy")

    End Sub

 

    Private Sub lstCountryBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstCountryBox.SelectedIndexChanged

        lblCountry.Text = lstCountryBox.Text

        Select Case lstCountryBox.SelectedIndex

            Case 0

                lblGreeting.Text = "Hello, programmer"

            Case 1

                lblGreeting.Text = "Hallo, programmierer"

            Case 2

                lblGreeting.Text = "Hola, programador"

            Case 3

                lblGreeting.Text = "Ciao, programmatore"

        End Select

    End Sub

 

    Private Sub btnGreeting_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGreeting.Click

        End

    End Sub

 

    Private Sub lstCountryBox_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstCountryBox.MouseHover

        If lstCountryBox.SelectedIndex < 0 Or _

          lstCountryBox.SelectedIndex > 4 Then

            lblGreeting.Text = "Please click the country name"

        End If

    End Sub

End Class

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