Sebelumnya maaf karna mungkin program ku ini blm terlalu bagus,,,karna aku skarang baru belajar VB.Net
Desain form Seperti berikut:
ketijan Source Kode berikut:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Focus()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
RadioButton1.Checked = False
RadioButton2.Checked = False
RadioButton3.Checked = False
RadioButton4.Checked = False
RadioButton5.Checked = False
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox1.Focus()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked = True Then
TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
ElseIf RadioButton2.Checked = True Then
TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
ElseIf RadioButton3.Checked = True Then
TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
ElseIf RadioButton4.Checked = True Then
TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
ElseIf RadioButton5.Checked = True Then
TextBox3.Text = Val(TextBox1.Text) ^ Val(TextBox2.Text)
End If
End Sub
End Class
kemudian jalankan programnya,,,bisa dengan menekan tombol F5...
semoga bermanfaat...
Membuat Kalkulator sederhana Dengan Visual Basic.Net 2008
Diposting oleh
aat_dCc
/ 08.12 /
4 komentar:
Ok juga....
Kayaknya masih ada yang harus diperbaiki diextnya Option5 (yang terakhir)...
Harusnya Pangkat bukan Bagi...
Tetap berkarya...
ok choy thanks................
ian sdh di ganti tuhh....
:)) :)] ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* : 8-} ~x( :-t b-( :-L x( =))
Posting Komentar