Başlangıç > Kodlar > VB.Net ile Basit bir hesap makinesi

VB.Net ile Basit bir hesap makinesi


Visual Basic.NET icin

Public Class Form1
Inherits System.Windows.Forms.Form
Dim k As Double
Dim p As Double
Dim flag As Double = 0


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = CDbl(Label1.Text & Button1.Text)
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Label1.Text = CDbl(Label1.Text & Button2.Text)
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Label1.Text = CDbl(Label1.Text & Button3.Text)
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Label1.Text = CDbl(Label1.Text & Button4.Text)
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Label1.Text = CDbl(Label1.Text & Button5.Text)
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Label1.Text = CDbl(Label1.Text & Button6.Text)
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Label1.Text = CDbl(Label1.Text & Button7.Text)
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Label1.Text = CDbl(Label1.Text & Button8.Text)
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Label1.Text = CDbl(Label1.Text & Button9.Text)
End Sub

Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
Label1.Text = CDbl(Label1.Text & Button11.Text)
End Sub

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
Label1.Text = Label1.Text & Button10.Text
End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
k = CDbl(Label1.Text)
Label1.Text = ""
flag = 1
End Sub

Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click
End
End Sub

Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
Label1.Text = ""
End Sub

Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
If flag = 1 Then
p = CDbl(Label1.Text)
Label1.Text = k + p
End If
If flag = 3 Then
p = CDbl(Label1.Text)
Label1.Text = k * p
End If
If flag = 4 Then
p = CDbl(Label1.Text)
Label1.Text = k / p
End If
If flag = 2 Then
p = CDbl(Label1.Text)
Label1.Text = k - p
End If
End Sub

Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
k = CDbl(Label1.Text)
Label1.Text = ""
flag = 3
End Sub

Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
k = CDbl(Label1.Text)
Label1.Text = ""
flag = 2
End Sub

Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
k = CDbl(Label1.Text)
Label1.Text = ""
flag = 4
End Sub

Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
k = CDbl(Label1.Text)
Label1.Text = ""
flag = 5
End Sub
End Class

Reklamlar
  1. Henüz yorum yapılmamış.
  1. No trackbacks yet.

Bir Cevap Yazın

Aşağıya bilgilerinizi girin veya oturum açmak için bir simgeye tıklayın:

WordPress.com Logosu

WordPress.com hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Twitter resmi

Twitter hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Facebook fotoğrafı

Facebook hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Google+ fotoğrafı

Google+ hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Connecting to %s

%d blogcu bunu beğendi: