kalkulator

 

Private sub cmdfinish_click()
unload me
end sub

private sub txtnilai1_keypress (keyascii as integer)
if keyascii = 13 then
txtnilai2.setfocus
end if
end sub

private sub txtnilai2_keypress (keyascii as integer)
if keyascii = 13 then
txtresuslt.setfocus
end if
end sub

private sub cmdplus_click()
dim a, b, c as double
a=val (txtnilai1.text)
b=val (txtnilai2.text)
c=(a+b)
txtresult.text=c
end sub

private sub cmdminus_click()
dim a, b, c as double
a=val (txtnilai1.text)
b=val (txtnilai2.text)
c=(a-b)
txtresult.text=c
end sub

private sub cmdkali_click()
dim a, b, c as double
a=val (txtnilai1.text)
b=val (txtnilai2.text)
c=(a*b)
txtresult.text=c
end sub

private sub cmdbagi_click()
dim a, b, c as double
a=val (txtnilai1.text)
b=val (txtnilai2.text)
c=(a/b)
txtresult.text=c
end sub

private sub cmdreset_click()
txtnilai1.setfocus
txtnilai1=””
txtnilai2=””
txtresult=””
end sub