CONTOH PROGRAM KALKULATOR
SILAHKAN DESAIN FORM DIBAWAH INI

 













TULIS LISTING PROGRAM DIBAWAH INI DENGAN CARA MENGKLIK FORM :

Public Class Form1
'Ketika button1 di klik maka akan mengerjakan perintah dibawah
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)
        Else
            TextBox3.Text = Val(TextBox1.Text) ^ Val(TextBox2.Text)

        End If
    End Sub
'Ketika button2 di klik maka akan mengerjakan perintah dibawah
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox1.Focus()
    End Sub
End Class


0 komentar:

Posting Komentar

Copyright 2010 Be programmer....?
Lunax Free Premium Blogger™ template by Introblogger