Cursors

Batman Begins

Camera

Rabu, 19 Februari 2014

Kalkulator dari VB

MEMBUAT APLIKASI KALKULATOR PALING SEDERHANA MENGGUNAKAN VB 6.0

Pagi Dunia,,

Kali ini saya Mau berbagi sedikit nhi tentang tutorial cara membuat Kalkulator  dengan menggunakan VB6.0 
Apabila sobat sudah banyak mengetahui nya Mohon jangan di Hina ya Blogg Ane,, :v Ane juga lagi dalam proses belajar..
Oke langsung aja deh jangan banyak BACOOOTT.. 
Ntar sobat Malah Bosen.. 




 
 buat seperti di atas ato terserah lah mau buat model kaya mna asal comond buttonya ada 15, text boxnya ada 3 dan 1 label..
di bawah ini codingnya..
Dim stt, stt2 As String
Private Sub Command1_Click()
If stt = "T" Then
Text1.Text = 7
Else
If stt2 = "T" Then
Text2.Text = 7
End If
End If
End Sub
Private Sub Command10_Click()
If stt = "T" Then
Text1.Text = 0
Else
If stt2 = "T" Then
Text2.Text = 0
End If
End If
End Sub
Private Sub Command11_Click()
Label1.Caption = "+"
End Sub
Private Sub Command12_Click()
Label1.Caption = "/"
End Sub
Private Sub Command13_Click()
Label1.Caption = "*"
End Sub
Private Sub Command14_Click()
Label1.Caption = "-"
End Sub
Private Sub Command15_Click()
If Label1.Caption = "+" Then
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Else
If Label1.Caption = "-" Then
Text3.Text = Val(Text1.Text) - Val(Text2.Text)
Else
If Label1.Caption = "*" Then
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
Else
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End If
End If
End If
End Sub
Private Sub Command2_Click()
If stt = "T" Then
Text1.Text = 8
Else
If stt2 = "T" Then
Text2.Text = 8
End If
End If
End Sub
Private Sub Command3_Click()
If stt = "T" Then
Text1.Text = 9
Else
If stt2 = "T" Then
Text2.Text = 9
End If
End If
End Sub
Private Sub Command4_Click()
If stt = "T" Then
Text1.Text = 4
Else
If stt2 = "T" Then
Text2.Text = 4
End If
End If
End Sub
Private Sub Command5_Click()
If stt = "T" Then
Text1.Text = 5
Else
If stt2 = "T" Then
Text2.Text = 5
End If
End If
End Sub
Private Sub Command6_Click()
If stt = "T" Then
Text1.Text = 6
Else
If stt2 = "T" Then
Text2.Text = 6
End If
End If
End Sub
Private Sub Command7_Click()
If stt = "T" Then
Text1.Text = 1
Else
If stt2 = "T" Then
Text2.Text = 1
End If
End If
End Sub
Private Sub Command8_Click()
If stt = "T" Then
Text1.Text = 2
Else
If stt2 = "T" Then
Text2.Text = 2
End If
End If
End Sub
Private Sub Command9_Click()
If stt = "T" Then
Text1.Text = 3
Else
If stt2 = "T" Then
Text2.Text = 3
End If
End If
End Sub
Private Sub Text1_click()
stt = "T"
stt2 = "F"
End Sub
Private Sub Text2_Click()
stt = "F"
stt2 = "T"
End Sub
ini lah hasil jadinya...

  
 
 selamat mencoba..(*_*)

Tidak ada komentar:

Posting Komentar