Professional Documents
Culture Documents
Coding Kalkulator Siap Diposkan
Coding Kalkulator Siap Diposkan
http://www.Word-to-PDF-Converter.net
Cara membuat kalkulator pada vb 6,0....
Option Explicit
Private Const opNol = 0
Private Const opTambah = 1
Private Const opKurang = 2
Private Const opKali = 3
Private Const opBagi = 4
Private operator As Integer
Private nilaibaru As Boolean
Private hasil, hasilbaru As Double
Private Sub cmdAngka_Click(Index As Integer)
If txtDisplay.Text = "0" Then txtDisplay.Text = ""
If nilaibaru Then
txtDisplay.Text = Format$(Index)
nilaibaru = False
Else
txtDisplay = _
txtDisplay & Format$(Index)
End If
End Sub
Private Sub cmdClear_Click()
cmdClearEntry_Click
operator = opNol
hasil = 0
End Sub
Private Sub cmdClearEntry_Click()
txtDisplay.Text = "0"
End Sub
Private Sub cmdHapus_Click()
Dim txt As String
Dim min_len As Integer
txt = txtDisplay.Text
If Left$(txt, 1) = "-" Then
min_len = 2
Else
min_len = 1
End If