Kali ini saya akan memberitahu bagaimana cara membuat aplikasi OPERATOR di VB EXPRES atau di VISUAL STUDIO, langsung saja:
- Seperti biasa buka vb express atau visua stuidio anda, buat program baru, buat 4 form, lalu design masing-masing formnya seperti di bawah ini :
- Ketikkan kode yang terdapat di bawah ini untuk form 1:Public Class Form1Sub combobox()ComboBox1.Items.Add("Operator")End SubPrivate Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChangedEnd SubPrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadCall combobox()End SubPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickIf ComboBox1.Text = "Operator" ThenForm2.Show()Me.Hide()End IfEnd SubEnd Class
- Ketikkan kode yang terdapat di bawah ini untuk form 2:Public Class Form2Private Sub RadioButton1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles RadioButton1.MouseClickForm3.Show()Form3.Label2.Text = "+"Me.Hide()End SubPrivate Sub RadioButton2_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles RadioButton2.MouseClickForm3.Show()Form3.Label2.Text = "-"Me.Hide()End SubPrivate Sub RadioButton3_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles RadioButton3.MouseClickForm3.Show()Form3.Label2.Text = "X"Me.Hide()End SubPrivate Sub RadioButton4_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles RadioButton4.MouseClickForm3.Show()Form3.Label2.Text = "/"Me.Hide()End SubEnd Class
- Ketikkan kode yang terdapat di bawah ini untuk form 3:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickForm4.Show()Me.Hide()End SubPrivate Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChangedIf Label2.Text = "+" ThenTextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)Form4.Label2.Text = Val(TextBox1.Text) + Val(TextBox2.Text)ElseIf Label2.Text = "-" ThenTextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)Form4.Label2.Text = Val(TextBox1.Text) - Val(TextBox2.Text)ElseIf Label2.Text = "X" ThenTextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)Form4.Label2.Text = Val(TextBox1.Text) * Val(TextBox2.Text)ElseIf Label2.Text = "/" ThenTextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)Form4.Label2.Text = Val(TextBox1.Text) / Val(TextBox2.Text)End IfEnd SubEnd Class
- Ketikkan kode yang terdapat di bawah ini untuk form 4:Public Class Form4Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickForm1.Show()Me.Hide()End SubPrivate Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickMe.Close()End SubEnd Class
PROGRAM OPERATOR SIAP UNTUK DI JALANKAN,SEMOGA PROGRAM OPERATOR ANDA DAPAT BERJALAN DENGAN BAIK SEKIAN DAN TERIMAKASIH
Komentar
Posting Komentar