Public Class Form1
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Select Case ComboBox2.SelectedIndex
Case 0
Label3.Text = "ชั่วโมง"
Price.Text = 880
TextBox1.Focus()
Case 1
Label3.Text = "วัน"
Price.Text = 1200
TextBox1.Focus()
Case 2
Label3.Text = "สัปดาห์"
Price.Text = 1500
TextBox1.Focus()
Case 3
Label3.Text = "เดือน"
Price.Text = 2500
TextBox1.Focus()
End Select
End Sub
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Price_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
Select Case ComboBox2.SelectedIndex
Case 0
ComboBox2.Text = "ชั่วโมง"
Price.Text = 880
TextBox1.Focus()
Case 1
Label1.Text = "วัน"
Price.Text = 1200
TextBox1.Focus()
Case 2
Label1.Text = "สัปดาห์"
Price.Text = 1500
TextBox1.Focus()
Case 3
Label1.Text = "เดือน"
Price.Text = 2000
TextBox1.Focus()
End Select
End Sub
Private Sub UserControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Price.TextChanged
End Sub
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox2.Clear()
TextBox2.Text += " เช่ารถยนต์ทั้งหมด " & TextBox1.Text & " " & Label3.Text & vbCrLf
TextBox2.Text += " ราคาทั้งสิ้น " & TextBox2.Text & " บาท" & vbCrLf
TextBox2.Text += " รับเงินทั้งสิ้น " & TextBox3.Text & " บาท" & vbCrLf
TextBox2.Text += " เงินทอน " & (TextBox3.Text - TextBox2.Text).ToString() & " บาท" & vbCrLfผิด
End Sub
End Class