hello,
I need help in simplifying these code......
i know how to use function in c language.....
but i don't know how to apply it in visual basic....
[XCODE]
Public Class Form1
' Dim secondform As New Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim from1, to1, cabin As String
'Dim adult, child, infant As Integer
'Dim sum As String
If ComboBox1.Text = "Alor Setar" Then
from1 = ComboBox1.Text
Label7.Text = from1
If ComboBox2.Text = "Kuala Lumpur" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
ElseIf ComboBox2.Text = "Kuantan" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
End If
ElseIf ComboBox1.Text = "Kuala Lumpur" Then
from1 = ComboBox1.Text
Label7.Text = from1
If ComboBox2.Text = "Kuantan" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
ElseIf ComboBox2.Text = "Alor Setar" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
End If
ElseIf ComboBox1.Text = "Kuantan" Then
from1 = ComboBox1.Text
Label7.Text = from1
If ComboBox2.Text = "Kuala Lumpur" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
ElseIf ComboBox2.Text = "Alor Setar" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
End If
End If
'secondform.Show()
End Sub
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Label1.Text = CStr(Me.DateTimePicker1.Value)
End Sub
End Class
[/XCODE]
I need help in simplifying these code......
i know how to use function in c language.....
but i don't know how to apply it in visual basic....
[XCODE]
Public Class Form1
' Dim secondform As New Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim from1, to1, cabin As String
'Dim adult, child, infant As Integer
'Dim sum As String
If ComboBox1.Text = "Alor Setar" Then
from1 = ComboBox1.Text
Label7.Text = from1
If ComboBox2.Text = "Kuala Lumpur" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
ElseIf ComboBox2.Text = "Kuantan" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
End If
ElseIf ComboBox1.Text = "Kuala Lumpur" Then
from1 = ComboBox1.Text
Label7.Text = from1
If ComboBox2.Text = "Kuantan" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
ElseIf ComboBox2.Text = "Alor Setar" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
End If
ElseIf ComboBox1.Text = "Kuantan" Then
from1 = ComboBox1.Text
Label7.Text = from1
If ComboBox2.Text = "Kuala Lumpur" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
ElseIf ComboBox2.Text = "Alor Setar" Then
Label8.Text = ComboBox2.Text
If ComboBox6.Text = "First Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Business Class" Then
Label9.Text = ComboBox6.Text
ElseIf ComboBox6.Text = "Economy Class" Then
Label9.Text = ComboBox6.Text
End If
End If
End If
'secondform.Show()
End Sub
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Label1.Text = CStr(Me.DateTimePicker1.Value)
End Sub
End Class
[/XCODE]