Cara Membuat Kalkulator Sederhana di Visual Studio 10 Termudah

0
1163
membuat kalkulator sederhana
membuat kalkulator sederhana

Salam IT, Oke gans di tutorial kali ini disini saya akan berbagi materi atau berbagi ilmu tentang cara membuat aplikasi sederhana di aplikasi sederhana visual basic yaitu membuat kalkulator sederhana.

Sebelumnya bisa dilihat oleh anda dibawah adalah tampilan hasil atau tampilan program kalkulator sederhana yang sudah jadi :

Erwin Widianto membuat-kalkulator-sederhana Cara Membuat Kalkulator Sederhana di Visual Studio 10 Termudah INFORMATIKA Pemrograman Visual  membuat kalkulator sederhana
membuat kalkulator sederhana

Nah itu tampilan program kalkulator sederhana applikasi kalkulator sederhana tersebut dibuat menggunakan applikasi aplikasi sederhana visual basic 10 atau visual studo 10.

Bagaimana cara membuat kalkulator sederhana?

Nah langsung saja ke pembahasan ya cara mmbuat kalkulator sederhana:

  1. SIlahkan anda buka aplikasi sederhana visual basic 10 nya.
  2. Silahkan Creat New Porject.
  3. Setelah itu silahkan anda buat desainya terlebih dahulu yah, untuk desainya silahkan anda samakan seperti tampilan program yang diatas yah.
  4. Setelah anda membuat desainya silahkan anda dubleclik pada From 1 maka akan mucul tampilan script atau kodingnya ya.
  5. Silahkan anda masukan Koding berikut
Public Class Kalkulator

    Const phi As Double = 22 / 7

    Dim input_angka, Hasil As Double

    Dim Rumus As String

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        TextBox1.Enabled = False

        Button1.Enabled = False

        Button2.Enabled = False

        Button3.Enabled = False

        Button4.Enabled = False

        Button5.Enabled = False

        Button6.Enabled = False

        Button7.Enabled = False

        Button8.Enabled = False

        Button9.Enabled = False

        Button10.Enabled = False

        Button11.Enabled = False

        Button12.Enabled = False

        Button13.Enabled = False

        Button14.Enabled = False

        Button15.Enabled = False

        Button16.Enabled = False

        Button17.Enabled = False

        Button18.Enabled = False

        Button19.Enabled = False

        Button20.Enabled = False

        Button22.Enabled = False

        Button23.Enabled = False

        Button24.Enabled = False

    End Sub

    Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click

            TextBox1.Text = TextBox1.Text & "0"

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

            TextBox1.Text = TextBox1.Text & "7"

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

            TextBox1.Text = TextBox1.Text & "8"

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

            TextBox1.Text = TextBox1.Text & "9"

    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

            TextBox1.Text = TextBox1.Text & "4"

    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click

        TextBox1.Text = TextBox1.Text & "5"

    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click

        TextBox1.Text = TextBox1.Text & "6"

    End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click

            TextBox1.Text = TextBox1.Text & "1"

    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click

        TextBox1.Text = TextBox1.Text & "2"

    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click

            TextBox1.Text = TextBox1.Text & "3"

    End Sub

    Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click

        TextBox1.Text = TextBox1.Text & "."

    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click

        input_angka = Val(TextBox1.Text)

        Rumus = "/"

        TextBox1.Text = Nothing

    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

            input_angka = Val(TextBox1.Text)

        Rumus = "-"

        TextBox1.Text = Nothing

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

            input_angka = Val(TextBox1.Text)

        Rumus = "+"

        TextBox1.Text = Nothing

    End Sub

    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click

            input_angka = Val(TextBox1.Text)

        Rumus = "^"

        TextBox1.Text = Nothing

    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click

            input_angka = Val(TextBox1.Text)

        Rumus = "*"

        TextBox1.Text = Nothing

    End Sub

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

        TextBox1.Text = Math.Sqrt(TextBox1.Text)

    End Sub

    Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click

        If Rumus = "+" Then

            TextBox1.Text = input_angka + Val(TextBox1.Text)

        ElseIf Rumus = "-" Then

            TextBox1.Text = input_angka - Val(TextBox1.Text)

        ElseIf Rumus = "*" Then

            TextBox1.Text = input_angka * Val(TextBox1.Text)

        ElseIf Rumus = "/" Then

            TextBox1.Text = input_angka / Val(TextBox1.Text)

        ElseIf Rumus = "^" Then

            TextBox1.Text = input_angka ^ Val(TextBox1.Text)

        End If

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

        TextBox1.Text = Nothing

        input_angka = Nothing

        Hasil = Nothing

        Rumus = Nothing

    End Sub

    Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click

        TextBox1.Enabled = False

        Button1.Enabled = False

        Button2.Enabled = False

        Button3.Enabled = False

        Button4.Enabled = False

        Button5.Enabled = False

        Button6.Enabled = False

        Button7.Enabled = False

        Button8.Enabled = False

        Button9.Enabled = False

        Button10.Enabled = False

        Button11.Enabled = False

        Button12.Enabled = False

        Button13.Enabled = False

        Button14.Enabled = False

        Button15.Enabled = False

        Button16.Enabled = False

        Button17.Enabled = False

        Button18.Enabled = False

        Button19.Enabled = False

        Button20.Enabled = False

        Button22.Enabled = False

        Button23.Enabled = False

        Button24.Enabled = False

    End Sub

    Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click

        TextBox1.Enabled = True

        Button1.Enabled = True

        Button2.Enabled = True

        Button3.Enabled = True

        Button4.Enabled = True

        Button5.Enabled = True

        Button6.Enabled = True

        Button7.Enabled = True

        Button8.Enabled = True

        Button9.Enabled = True

        Button10.Enabled = True

        Button11.Enabled = True

        Button12.Enabled = True

        Button13.Enabled = True

        Button14.Enabled = True

        Button15.Enabled = True

        Button16.Enabled = True

        Button17.Enabled = True

        Button18.Enabled = True

        Button19.Enabled = True

        Button20.Enabled = True

        Button22.Enabled = True

        Button23.Enabled = True

        Button24.Enabled = True

    End Sub

    Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click

        TextBox1.Text = Math.Cos(TextBox1.Text * (phi / 180))

    End Sub

    Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button23.Click

        TextBox1.Text = Math.Sin(TextBox1.Text * (phi / 180))

    End Sub

    Private Sub Button24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button24.Click

        TextBox1.Text = Math.Tan(TextBox1.Text * (phi / 180))

    End Sub

    Private Sub Button25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button25.Click

        If TextBox1.Text.Length <> 0 Then

            TextBox1.Text = TextBox1.Text.Remove(TextBox1.Text.Length - 1)

        End If

    End Sub

End Class
  • Nah setelah anda mengganti codingnya dengan coding yang diatas silahkan anda sesuaikan tolboox toolbox nya sesuai cing di atas.
  • Setelah anda menyesuaikannya silahkan anda klik run atau jalankan program dan selesai maka membuat kalkulator sederhana seperti yang diatas sudah beres.

Dan bilamana anda tidak ingin ribet silahkan anda download hasil membuat kalkulator sederhana sebuah project yang sudah saya biat silahkan klik link dibawah.

Cara Download Project :

  1. Link Download
  2. Buka link diatas tunggu 5 detik
  3. Klik scip AD
  4. Dan download.

Cara menjalankan Project yang di download :

  1. Extract File yang sudah di download diatas
  2. Buka aplikasi sederhana visual basic atau visual studio 10 nya
  3. Silahkan Plik Open Project
  4. Lalu silahkan pilih file yang sudah di download diatas.
  5. Lalu jalankan dan beres.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.