HOW TO CREATE CALCULATOR IN VISUAL BASIC 2010 Expert

in #tutorial7 years ago

ASSALAMU’ALAIKUM . WR . WB

<div> <p dir="auto">Selamat malam para steemian/pembaca dimana pun anda berada, semoga selalu diberikan kesehatan dan rezeki yang berlimpah. Setelah sekitar lebih kurang seminggu saya tidak membuat postingan dikarenaka kesibukan akan satu dua hal sebagaimana kesibukan mahasiswa pada umumnya. Pada malam ini saya akan mencoba memberikan sedikit tutorial tentang membuat program sederhana menggunakan <em>Visual Basic. <div> <p dir="auto">Sebeum saya melanjutkan ketutorialnya, saya akan sedikit membahas tentang apa itu<em>Visual Basic. <em>Visual Basic ini masi bernaung kepada microsoft, sering disebut dengan <em>VB, yaitu singkatan dari Visual Basic. VB merupakan sebuah bahasa pemograman <em>Integrated Development Environment (IDE) digunakan untuk membuat software berbasis SO Microsoft Windows dengan menggunakan model pemograman (COM). Naah, jadi si VB ini bahasa pemograman untuk membuat sebuah software yang hanya bisa dipakai pada Sistem Operasi Windows saja guys. <div> <p dir="auto">Baik saya rasa cukup untuk intermezo tentang VB, untuk lebih jelasnya, agan-agan bisa googling pada <em>Mbah Google. Naah jadi tutorial yang ingin saya bagikan ini adalah, <em>Cara Membuat Calculator. Disini saya menggunakan Visual Basic 2010 Expert. Anda semua bisa menggunakan VB jenis apa saja. <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/6u35py38yf.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/6u35py38yf.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/6u35py38yf.jpg 2x" /> <p dir="auto">Baik, langkah pertama pastinya, anda semua harus membuka terlebih dahulu VB anda. <hr /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/he17x57vb7.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/he17x57vb7.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/he17x57vb7.jpg 2x" /> <p dir="auto">Pada gambar diatas menjelaskan bagaimana cara anda untuk membuat <em>project baru. <hr /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/yff3ajbtk7.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/yff3ajbtk7.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/yff3ajbtk7.jpg 2x" /> <div> <p dir="auto">Disini saya menganggap bahwa anda semua sdah memahami bagaimana caranya membuat <em>Text Box, Button, Dan lain-lain. Coba lah anda desine lembar <em>project anda persis seperti ini, dengan ketentuan : <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/q4d8g6eoc7.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/q4d8g6eoc7.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/q4d8g6eoc7.jpg 2x" /> <p dir="auto">Anda beri nama <strong>”layar”. <hr /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/4w6zo54qvg.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/4w6zo54qvg.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/4w6zo54qvg.jpg 2x" /> <p dir="auto">Anda beri nama <strong>”nomor1” s/d <strong>”nomor0”. <hr /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/9oku3g7y62.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/9oku3g7y62.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/9oku3g7y62.jpg 2x" /> <p dir="auto">Anda beri nama <strong>”tambah”, “kurang”, “kali”, dan “bagi”. <hr /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/we5d96nq03.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/we5d96nq03.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/we5d96nq03.jpg 2x" /> <p dir="auto">Anda beri nama <strong>”clear”. <hr /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/1kuopc96w3.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/1kuopc96w3.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/1kuopc96w3.jpg 2x" /> <p dir="auto">Anda beri nama <strong>”titik” dan <strong>”jumlah”. <hr /> <p dir="auto">Setelah anda membuat sedemikian rupa, anda bisa mengcopy <em>coding berikut. <p dir="auto"><code> <p dir="auto">Public Class Form1 <pre><code>Dim Firstnum As Decimal Dim Secondnum As Decimal Dim Operations As Integer Dim Operator_Selector As Boolean = False Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub nomor1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor1.Click If layar.Text <> "0" Then layar.Text += "1" Else layar.Text = "1" End If End Sub Private Sub nomor2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor2.Click If layar.Text <> "0" Then layar.Text += "2" Else layar.Text = "2" End If End Sub Private Sub nomor3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor3.Click If layar.Text <> "0" Then layar.Text += "3" Else layar.Text = "3" End If End Sub Private Sub nomor4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor4.Click If layar.Text <> "0" Then layar.Text += "4" Else layar.Text = "4" End If End Sub Private Sub nomor5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor5.Click If layar.Text <> "0" Then layar.Text += "5" Else layar.Text = "5" End If End Sub Private Sub nomor6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor6.Click If layar.Text <> "0" Then layar.Text += "6" Else layar.Text = "6" End If End Sub Private Sub nomor7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor7.Click If layar.Text <> "0" Then layar.Text += "7" Else layar.Text = "7" End If End Sub Private Sub nomor8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor8.Click If layar.Text <> "0" Then layar.Text += "8" Else layar.Text = "8" End If End Sub Private Sub nomor9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor9.Click If layar.Text <> "0" Then layar.Text += "9" Else layar.Text = "9" End If End Sub Private Sub nomo0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nomor0.Click, nomo0.Click If layar.Text <> "0" Then layar.Text += "0" End If End Sub Private Sub clear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clear.Click layar.Text = "0" End Sub Private Sub titik_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles titik.Click If Not (layar.Text.Contains(".")) Then layar.Text += "." End If End Sub Private Sub tambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tambah.Click Firstnum = layar.Text layar.Text = "0" Operator_Selector = True Operations = 1 ' = + End Sub Private Sub kurang_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kurang.Click Firstnum = layar.Text layar.Text = "0" Operator_Selector = True Operations = 2 ' = - End Sub Private Sub kali_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kali.Click Firstnum = layar.Text layar.Text = "0" Operator_Selector = True Operations = 3 ' = * End Sub Private Sub bagi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bagi.Click Firstnum = layar.Text layar.Text = "0" Operator_Selector = True Operations = 4 ' = / End Sub Private Sub jumlah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jumlah.Click If Operator_Selector = True Then Secondnum = layar.Text If Operations = 1 Then layar.Text = Firstnum + Secondnum ElseIf Operations = 2 Then layar.Text = Firstnum - Secondnum ElseIf Operations = 3 Then layar.Text = Firstnum * Secondnum ElseIf Secondnum = 0 Then layar.Text = "Error!" Else layar.Text = Firstnum / Secondnum End If End If Operator_Selector = False End Sub <p dir="auto">End Class <p dir="auto"> <hr /> <p dir="auto">Bisa anda lihat juga pada gambar brikut ini. <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/zfilb4opqy.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/zfilb4opqy.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/zfilb4opqy.jpg 2x" /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/swg1692ahn.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/swg1692ahn.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/swg1692ahn.jpg 2x" /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/5pkz2y64ty.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/5pkz2y64ty.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/5pkz2y64ty.jpg 2x" /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/nh84rf4ogz.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/nh84rf4ogz.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/nh84rf4ogz.jpg 2x" /> <hr /> <div> <p dir="auto">Setelah anda memasukkan coding tersebut dengan sesuai, maka tinggal anda jalankan software tersebut. <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/9i0mqmpm3g.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/9i0mqmpm3g.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/9i0mqmpm3g.jpg 2x" /> <hr /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/aajuseeud2.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/aajuseeud2.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/aajuseeud2.jpg 2x" /> <div> <p dir="auto">Pada gambar diatas adalah tampilan setelah saya menjalankan software. Sebagai contoh saya membagi <strong>2018 : 19. Hasilnya seperti pada gambar diatas. <hr /> <div> <p dir="auto">Nah sekian dulu postingan saya pada malam hari ini, semoga kedepannya saya bisa memprioritaskan untuk memuat tutorial – tutorial lainnya lagi. Terimakasih telah membaca postingan saya, dan jika ada kekurangan atau kesalahan pada postingan ini bisa anda koreksi dengan mengomentari aritkel iini. <hr /> <p dir="auto"><img src="https://images.hive.blog/768x0/https://img.esteem.ws/p2489pxa2y.jpg" alt="image" srcset="https://images.hive.blog/768x0/https://img.esteem.ws/p2489pxa2y.jpg 1x, https://images.hive.blog/1536x0/https://img.esteem.ws/p2489pxa2y.jpg 2x" /> <hr /> <h1><center><strong><span>FOLLOW <a href="/@belajar.ngoding">@belajar.ngoding
Sort:  

Congratulations @belajar.ngoding! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

<p dir="auto"><a href="http://steemitboard.com/@belajar.ngoding" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><img src="https://images.hive.blog/768x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png" srcset="https://images.hive.blog/768x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png 1x, https://images.hive.blog/1536x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png 2x" /> Award for the number of upvotes <p dir="auto">Click on any badge to view your own Board of Honor on SteemitBoard. <p dir="auto">To support your work, I also upvoted your post!<br /> For more information about SteemitBoard, click <a href="https://steemit.com/@steemitboard" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here <p dir="auto">If you no longer want to receive notifications, reply to this comment with the word <code>STOP <blockquote> <p dir="auto">Upvote this notification to help all Steemit users. Learn why <a href="https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here!

Hello, as a member of @steemdunk you have received a free courtesy boost! Steemdunk is an automated curation platform that is easy to use and built for the community. Join us at https://steemdunk.xyz

Upvote this comment to support the bot and increase your future rewards!

Congratulations @belajar.ngoding! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

<p dir="auto"><a href="http://steemitboard.com/@belajar.ngoding" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><img src="https://images.hive.blog/768x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png" srcset="https://images.hive.blog/768x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png 1x, https://images.hive.blog/1536x0/https://steemitimages.com/70x80/http://steemitboard.com/notifications/votes.png 2x" /> Award for the number of upvotes <p dir="auto">Click on any badge to view your own Board of Honor on SteemitBoard.<br /> For more information about SteemitBoard, click <a href="https://steemit.com/@steemitboard" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here <p dir="auto">If you no longer want to receive notifications, reply to this comment with the word <code>STOP <blockquote> <p dir="auto">Upvote this notification to help all Steemit users. Learn why <a href="https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here! <p dir="auto">Do not miss the <a href="https://steemit.com/easter/@steemitboard/celebrate-easter-with-steemitboard-the-eggs-opened-and-guess-what-popped-out" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">last announcement<span> from <a href="/@steemitboard">@steemitboard!

Congratulations @belajar.ngoding! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td><span><img src="https://images.hive.blog/768x0/https://steemitimages.com/60x70/http://steemitboard.com/@belajar.ngoding/votes.png?201811181514" srcset="https://images.hive.blog/768x0/https://steemitimages.com/60x70/http://steemitboard.com/@belajar.ngoding/votes.png?201811181514 1x, https://images.hive.blog/1536x0/https://steemitimages.com/60x70/http://steemitboard.com/@belajar.ngoding/votes.png?201811181514 2x" /><td>You made more than 900 upvotes. Your next target is to reach 1000 upvotes. <p dir="auto"><sub><em><a href="https://steemitboard.com/@belajar.ngoding" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Click here to view your Board of Honor<br /> <sub><em>If you no longer want to receive notifications, reply to this comment with the word <code>STOP <p dir="auto"><strong><span>Do not miss the last post from <a href="/@steemitboard">@steemitboard: <table><tr><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-special-attendees-revealed" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><img src="https://images.hive.blog/768x0/https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png" srcset="https://images.hive.blog/768x0/https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png 1x, https://images.hive.blog/1536x0/https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png 2x" /><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-special-attendees-revealed" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Meet the Steemians Contest - Special attendees revealed<tr><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-intermediate-results" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><img src="https://images.hive.blog/768x0/https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png" srcset="https://images.hive.blog/768x0/https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png 1x, https://images.hive.blog/1536x0/https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png 2x" /><td><a href="https://steemit.com/steemfest/@steemitboard/meet-the-steemians-contest-intermediate-results" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Meet the Steemians Contest - Intermediate results <blockquote> <p dir="auto">Support <a href="https://steemit.com/@steemitboard" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">SteemitBoard's project! <strong><a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Vote for its witness and <strong>get one more award!

Congratulations @belajar.ngoding! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @belajar.ngoding! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!