1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| Public Class Form1
Inherits System.Windows.Forms.Form
Dim spe() As String = {"pediatre", "neurologue", "génecologue"}
Dim vil() As String = {"meknes", "rabat", "fes"}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For i As Int16 = 0 To spe.Length - 1
If ComboBox1.Items.Contains(spe(i)) = False Then
ComboBox1.Items.Add(spe(i))
End If
Next
ComboBox1.Items.Add("indifférent")
For i As Int16 = 0 To vil.Length - 1
If ComboBox2.Items.Contains(vil(i)) = False Then
ComboBox2.Items.Add(vil(i))
End If
Next
ComboBox2.Items.Add("indifférent")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim specialité As String
Dim nom As String
Dim sexe As String
Dim ville As String
If ComboBox1.SelectedItem <> "indifférent" Then
specialité = ComboBox1.SelectedItem & " and"
Else
specialité = ""
If txtnom.Text <> "" Then
nom = txtnom.Text & " and"
Else
nom = ""
If RadioButton1.Checked = True Then
sexe = RadioButton1.Checked & " and"
ElseIf RadioButton2.Checked = True Then
sexe = RadioButton2.Checked & " and"
ElseIf RadioButton3.Checked = True Then
sexe = ""
If ComboBox2.SelectedItem <> "indifférent" Then
ville = ComboBox2.SelectedItem
Else
ville = ""
End If
End If
End If
End If
Label5.Text = specialité & nom & sexe & ville
End Sub
End Class |
Partager