Dim b, a
Private Sub saat_Click()
Kapat.Visible = False
temizle.Visible = False
kare.Visible = False
küp.Visible = False
modu.Visible = False
kök.Visible = False
Eşittir.Visible = False
toplama.Visible = False
Kapat.Visible = False
temizle.Visible = False
çıkartma.Visible = False
Label1.Visible = False
Line1.Visible = False
Line2.Visible = False
Line3.Visible = False
Line4.Visible = False
çarpma.Visible = False
bölme.Visible = False
Text1.Visible = False
Bir.Visible = False
iki.Visible = False
üç.Visible = False
dört.Visible = False
beş.Visible = False
altı.Visible = False
yedi.Visible = False
sekiz.Visible = False
dokuz.Visible = False
nokta.Visible = False
ç_sıfır.Visible = False
sıfır.Visible = False
yüzde.Visible = False
makine.Visible = True
saat.Visible = False
End Sub
Private Sub makine_Click()
Kapat.Visible = True
temizle.Visible = True
kare.Visible = True
küp.Visible = True
modu.Visible = True
kök.Visible = True
Eşittir.Visible = True
toplama.Visible = True
Kapat.Visible = True
temizle.Visible = True
çıkartma.Visible = True
Label1.Visible = True
Line1.Visible = True
Line2.Visible = True
Line3.Visible = True
Line4.Visible = True
çarpma.Visible = True
bölme.Visible = True
Text1.Visible = True
Bir.Visible = True
iki.Visible = True
üç.Visible = True
dört.Visible = True
beş.Visible = True
altı.Visible = True
yedi.Visible = True
sekiz.Visible = True
dokuz.Visible = True
nokta.Visible = True
ç_sıfır.Visible = True
sıfır.Visible = True
yüzde.Visible = True
saat.Visible = True
makine.Visible = False
End Sub
Private Sub Form_Load()
Dim aci, i, t
AutoRedraw = True
Timer1.Interval = 1000 '1 saniye
Timer2.Interval = 10 '1 salise
ScaleMode = 3
For i = 0 To ScaleHeight
Line (0, i)-(ScaleWidth, i), i * 256
Next
ScaleMode = 1
Width = ScaleHeight
Scale (-20, 20)-(20, -20)
t = "YILDIZ"
CurrentX = -TextWidth(t) / 2
CurrentY = -1
Print t
t = "Mustafa YILDIZ Bilgisayar 3 Maltepe Üniversitesi"
CurrentX = -TextWidth(t) / 4
CurrentY = -4
Print t
DrawWidth = 5
Circle (0, 0), 19, 65535
DrawWidth = 2
For aci = 0 To 360 Step 6
Line (18 * Cos(aci * 3.1415 / 180), 18 * Sin(aci * 3.1415 / 180))-(19 * Cos(aci * 3.1415 / 180), 19 * Sin(aci * 3.1415 / 180)), QBColor(5)
Next
DrawWidth = 4
For aci = 0 To 360 Step 6 * 5
Line (18 * Cos(aci * 3.1415 / 180), 18 * Sin(aci * 3.1415 / 180))-(19 * Cos(aci * 3.1415 / 180), 19 * Sin(aci * 3.1415 / 180)), QBColor(8)
Next
DrawMode = 7
End Sub
Private Sub Timer1_Timer()
Dim aci, saniye, dakika, saat, i
Static sx, sy, dx, dy, stx, sty
Caption = Time
DrawWidth = 2
Line (0, 0)-(sx, sy), QBColor(10)
saniye = Second(Time)
aci = -saniye * 6 + 90
sx = 18 * Cos(aci * 3.1415 / 180)
sy = 18 * Sin(aci * 3.1415 / 180)
Line (0, 0)-(sx, sy), QBColor(10)
DrawWidth = 3
Line (0, 0)-(dx, dy), QBColor(11)
dakika = Minute(Time)
aci = -dakika * 6 + 90
dx = 18 * Cos(aci * 3.1415 / 180)
dy = 18 * Sin(aci * 3.1415 / 180)
Line (0, 0)-(dx, dy), QBColor(11)
DrawWidth = 3
Line (0, 0)-(stx, sty), QBColor(12)
saat = Hour(Time)
aci = -saat * 30 + 90
stx = 12 * Cos(aci * 3.1415 / 180)
sty = 12 * Sin(aci * 3.1415 / 180)
Line (0, 0)-(stx, sty), QBColor(12)
If Minute(Time) = 0 Then Beep
End Sub
Private Sub Timer2_Timer()
Static sls
sls = (sls + 1) Mod 360
Dim aci
Dim sx, sy, dx, dy, stx, sty
DrawWidth = 1
aci = -sls * 3.6 + 90
sx = 3 * Cos(aci * 3.1415 / 180)
sy = 3 * Sin(aci * 3.1415 / 180)
Line (5, 5)-(5 + sx, 5 + sy), QBColor(10)
Line (-5, 5)-(-5 - sx, 5 - sy), QBColor(10)
End Sub
Private Sub Kapat_Click()
mesaj = MsgBox("Hesap Makinesinden Çıkmak İstiyormusunuz?", vbYesNo + vbQuestion, "Hesap Makinesi")
If mesaj = 7 Then
Form1.Show
Else
End
End If
End Sub
Private Sub iki_Click()
Text1.Text = Text1.Text & 2
End Sub
Private Sub bir_Click()
Text1.Text = Text1.Text & 1
End Sub
Private Sub yedi_Click()
Text1.Text = Text1.Text & 7
End Sub
Private Sub altı_Click()
Text1.Text = Text1.Text & 6
End Sub
Private Sub beş_Click()
Text1.Text = Text1.Text & 5
End Sub
Private Sub üç_Click()
Text1.Text = Text1.Text & 3
End Sub
Private Sub dört_Click()
Text1.Text = Text1.Text & 4
End Sub
Private Sub nokta_Click()
Text1.Text = Text1.Text & "."
End Sub
Private Sub ç_sıfır_Click()
Text1.Text = Text1.Text & 0 & 0
End Sub
Private Sub sıfır_Click()
Text1.Text = Text1.Text & 0
End Sub
Private Sub dokuz_Click()
Text1.Text = Text1.Text & 9
End Sub
Private Sub sekiz_Click()
Text1.Text = Text1.Text & 8
End Sub
Private Sub toplama_Click()
a = Text1.Text
Label1.Caption = "+"
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub yüzde_click()
a = Text1.Text
Label1.Caption = "%"
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub çıkartma_Click()
a = Text1.Text
Label1.Caption = "-"
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub çarpma_Click()
a = Text1.Text
Label1.Caption = "x"
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub bölme_Click()
a = Text1.Text
Label1.Caption = "÷"
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub temizle_click()
Text1.Text = " "
Label1.Caption = " "
Text1.SetFocus
End Sub
Private Sub kare_click()
a = Text1.Text
b = Val(a) * Val(a)
Text1.Text = b
Text1.SetFocus
End Sub
Private Sub kök_click()
a = Text1.Text
b = Sqr(a)
Text1.Text = b
Text1.SetFocus
End Sub
Private Sub küp_click()
a = Text1.Text
b = Val(a) * Val(a) * Val(a)
Text1.Text = b
Text1.SetFocus
End Sub
Private Sub mod_click()
a = Text1.Text
Label1.Caption = "Mod"
Text1 = ""
Text1.SetFocus
End Sub
Private Sub eşittir_Click()
b = Text1.Text
If (Label1.Caption = "+") Then
Text1.Text = Val(a) + Val(b)
Else
If (Label1.Caption = "-") Then
Text1.Text = Val(a) - Val(b)
Else
If (Label1.Caption = "÷") Then
Text1.Text = Val(a) / Val(b)
Else
If (Label1.Caption = "x") Then
Text1.Text = Val(a) * Val(b)
Else
If (Label1.Caption = "x ^ 2") Then
b = Val(a) * Val(a)
Text1.Text = b
Else
If (Label1.Caption = "x ^ 3") Then
Text1.Text = Val(a) * Val(a) * Val(a)
Else
If (Label1.Caption = "|") Then
Text1.Text = Sqr(a)
Else
If (Label1.Caption = "Mod") Then
Text1.Text = Val(a) Mod Val(b)
Else
If (Label1.Caption = "%") Then
Text1.Text = Val(a) * Val(b) / 100
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub