Friday, April 12, 2013

How to make simple Calculator with VB.Net



Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click, Button5.Click
        Dim a As String = CType(sender, Button).Text
        Dim b As Integer
        If Me.TextBox1.Text = "" Or Me.TextBox2.Text = "" Then
            MsgBox("Kolom Kosong", MsgBoxStyle.Critical, "Warning")
            If a = "C" Then
                Me.TextBox1.Text = ""
                Me.TextBox2.Text = ""
                Me.TextBox3.Text = ""
            End If
        Else
            If IsNumeric(Me.TextBox1.Text) = False Or IsNumeric(Me.TextBox2.Text) = False Then
                MsgBox("Inputan Hanya Berupa Angka", MsgBoxStyle.Exclamation, "Warning")
                If a = "C" Then
                    Me.TextBox1.Text = ""
                    Me.TextBox2.Text = ""
                    Me.TextBox3.Text = ""
                End If

            Else
                If a = "x" Then
                    Me.TextBox3.Text = TextBox1.Text * TextBox2.Text
                    b = CInt(Me.TextBox3.Text)
                    If b >= 0 Then
                        Me.TextBox3.BackColor = Color.Blue
                        Me.TextBox3.Font = New Drawing.Font("Arial", 20, FontStyle.Bold)
                    ElseIf b < -1 Then
                        Me.TextBox3.BackColor = Color.Red
                        Me.TextBox3.Font = New Drawing.Font("Courier New", 10, FontStyle.Italic)
                    End If
                ElseIf a = "/" Then
                    If Me.TextBox1.Text = 0 Or Me.TextBox2.Text = 0 Then
                        MsgBox("Pembagi Tidak Boleh 0", MsgBoxStyle.Critical, "!! Warning !!")
                    Else
                        Me.TextBox3.Text = TextBox1.Text / TextBox2.Text
                        b = CInt(Me.TextBox3.Text)
                        If Me.TextBox3.Text.Length > 4 Then
                            Dim c As String = Me.TextBox3.Text.Substring(0, 4)
                            Me.TextBox3.Text = c
                            If b >= 0 Then
                                Me.TextBox3.BackColor = Color.Blue
                                Me.TextBox3.Font = New Drawing.Font("Arial", 20, FontStyle.Bold)
                            ElseIf b < -1 Then
                                Me.TextBox3.BackColor = Color.Red
                                Me.TextBox3.Font = New Drawing.Font("Courier New", 10, FontStyle.Italic)
                            End If
                        End If
                    End If
                ElseIf a = "+" Then
                    Dim x As Integer = CInt(Me.TextBox1.Text)
                    Dim y As Integer = CInt(Me.TextBox2.Text)
                    Me.TextBox3.Text = x + y
                    b = CInt(Me.TextBox3.Text)
                    If b >= 0 Then
                        Me.TextBox3.BackColor = Color.Blue
                        Me.TextBox3.Font = New Drawing.Font("Arial", 20, FontStyle.Bold)
                    ElseIf b < -1 Then
                        Me.TextBox3.BackColor = Color.Red
                        Me.TextBox3.Font = New Drawing.Font("Courier New", 10, FontStyle.Italic)
                    End If
                ElseIf a = "-" Then
                    Me.TextBox3.Text = TextBox1.Text - TextBox2.Text
                    b = CInt(Me.TextBox3.Text)
                    If b >= 0 Then
                        Me.TextBox3.BackColor = Color.Blue
                        Me.TextBox3.Font = New Drawing.Font("Arial", 20, FontStyle.Bold)
                    ElseIf b < -1 Then
                        Me.TextBox3.BackColor = Color.Red
                        Me.TextBox3.Font = New Drawing.Font("Courier New", 10, FontStyle.Italic)
                    End If
                End If
                If a = "C" Then
                    Me.TextBox1.Text = ""
                    Me.TextBox2.Text = ""
                    Me.TextBox3.Text = ""
                End If
            End If
        End If
    End Sub

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

    End Sub
End Class

by : 562010008@student.uksw.edu (Watashi no kantan'na memo)

108 comments:

  1. makasih buat tutorialnya ijin mempelajari dulu

    ReplyDelete
    Replies
  2. This is a very significant blog. Thanks for sharing your thoughts. Keep up the good job in posting very good topics.

    ReplyDelete
  3. thanks, i am looking forward to using vb.net soon!

    ReplyDelete
  4. Replies
    1. hello bos. I have a great respect for incremental improvement, and I've done that sort of thing in my life, but I've always been attracted to the Totojitu more revolutionary changes. I appreciate you for making the effort to jot down this informative article invaluable! I am considering novels of this nature for 8Togel the way too long. I'll be basically cheerful that we experienced your website. What youre saying is completely true. I know that everybody must say the same thing Lotus4D, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so King4D well with what youre trying to say. Im sure youll reach so many people with what youve got to say. I don't know why. Because they're harder. They're much more stressful emotionally. And you usually go through a period where Togel Singapore everybody tells you that you've completely failed. Well this is very extraordinary indeed. I adore to read a little about this meticulous topic. Great Article. Its in fact very informatics blog, I just would like to say that I found this precious blog with Togel Hongkong the help of Google. and I hope that you will be keep posting such type of Articles. thanks so mouch my friendss

      Delete
  5. motobola.org
    Agen Bola, Agen Judi, Agen Bola Online, Judi Online, Casino Online, Togel Online, Tangkas Online, Bandar Bola, Agen

    Betting, Poker Online
    Agen Bola
    Agen Judi
    Agen Bola Online
    Judi Online
    Casino Online
    Togel Online
    Tangkas Online
    Bandar Bola
    Agen Betting
    Poker Online
    Berita Bola

    ReplyDelete
  6. http://celebrityoftheworld.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    http://oesaha.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    http://mungkindanbo.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    http://west-java-indonesia.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    http://iklan-pertama.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    http://selebriti-nusantara.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    http://indonesia-lovers.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    http://j-handycraft.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    http://pertamadiblogger.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    http://banerbanner.blogspot.com/2014/03/agen-bola-terpercaya-terbaik.html
    go88bet.com Agen Judi, Agen Judi Bola, Agen Bola Online, Agen SBObet Terpercaya
    KAISARBET.COM AGEN BOLA TERPERCAYA PIALA DUNIA 2014
    MASTERPOKER88.COM JUDI POKER ONLINE UANG ASLI INDONESIA RESMI DAN TERPERCAYA

    ReplyDelete
  7. jasa seo google - http://www.jasaseogoogle.web.id
    jasa seo termurah - http://www.jasaseotermurah.web.id
    jasa seo indonesia - http://www.jasaseoindonesia.web.id
    jasa blog - http://www.jasablog.org
    jasa backlink - http://www.jasablog.org/jasa-backlink
    Jasa Toko Online - http://www.jasablog.org/jasa-toko-online
    Jasa SEO - http://www.jasablog.org/jasa-seo
    Jasa Penulisan Artikel - http://www.jasablog.org/jasa-konten
    Jasa Pembuatan Website - http://www.jasablog.org/jasa-pembuatan-website
    jasa brosur - http://www.jasabrosur.com
    Content Artikel - http://www.contentwritter.web.id
    Kabar Selebriti - http://kabarselebriti.com
    Informasi Hewan - http://www.hewan.org
    Tips Menang - http://www.tipsmenang.com

    ReplyDelete
  8. Nowadays the optimism of students who pay for essay writing http://papersmart.net/pay-for-essay.html website for the first time or on a regular basis can make them think in alternative way and meaning. You can hire best writing services that can prove its abilities to compose serious pieces and information for my university this semester.

    ReplyDelete
  9. Having read this I thought it was rather informative. I appreciate you finding the time and energy to put this content together. I once again find myself spending a lot of time both reading and posting comments. But so what, it was still worth it!

    Regards:

    [url]http://www.puribalirentcar.com[/url]

    Cheap Bali Car Hire

    Cheap Car Rental In Bali

    Sewa Mobil Murah Di Bali

    Sewa Mobil Murah Di Bali

    Cheap Bali Car Rental

    Sewa Mobil Di Bali

    Sewa Mobil Bali

    Bali Car Rental

    Penyewaan Mobil Murah Di Bali

    Penyewaan Mobil Di Bali

    Penyewaan Mobil Bali

    Rental Mobil Murah Di Bali

    Rental Mobil Di Bali

    Rental Mobil Bali

    Rent Car Murah Di Bali

    Rent Car Di Bali

    Rent Car Bali

    ReplyDelete
  10. Nice information. I was searching for the same. It helped me alot and saved my time. Thanks alot. upma recipe

    ReplyDelete
  11. welcome to our website here uda rino provides articles kata kata cinta, kata kata mutiara, kata kata lucu, kata kata galau and many other interesting article, thank you!

    ReplyDelete
  12. This information is I really need most
    Thank you very much sharing, Have good day
    Bali Driver and Bali Tours

    ReplyDelete
  13. Terima kasih untuk tutorialnya, ini sangat menarik.
    iklan gratis

    ReplyDelete
  14. ah bangsat loo tai spam semua anjing

    ReplyDelete
  15. It's really interesting for me, thank you so much.
    iklan71

    ReplyDelete
  16. Having read this I thought it was rather informative. I appreciate you finding the time and energy to put this content together. I once again find myself spending a lot of time both reading and posting comments. But so what, it was still worth it!
    Oppo

    ReplyDelete
  17. This is a very significant blog. Thanks for sharing your thoughts. Keep up the good job in posting very good topics.
    islamabad

    ReplyDelete
  18. The content of your article page is great, I found the content pretty good and useful to me, thank you for sharing.

    ReplyDelete
  19. https://greasyfork.org/en/users/219490-ceko-rizky

    Gatot4D Is The Most Trusted Online Togel Agent And Becomes The Best Togel Bandar That Provides Your Online Togel Prediction Service.

    Trusted Bandar Togel and the entire team are committed to continue to give satisfaction to the loyal members of this trusted lottery agent site by providing friendly and super fast service in all chat and transactions.

    agen togel terpercaya

    ReplyDelete
  20. BandarPoker Trust is that BandarQ Agent, BandarQQ, Domino QQ Online, Trusted Poker
    The BandarPokerTer language allows the entire team to benefit the loyal members of our Trusted
    Online Poker Site by providing friendly and super fast service in a variety of chat and transactions 24 hours a day to help players on various questions or basics. THANK YOU and WELCOME TO JOIN :)

    situs poker

    ReplyDelete
  21. Pro9kiu.com is the Trusted Online BandarQ Online Agent and Domino Qiu Qiu / 99 / QQ which provides game Bandarq, Online Poker, Capsa Susun, AduQ, Bandar Poker, DominoQQ, Sakong and Bandar 66. Pro QQ is here to become one of the online gambling agent sites safe and reliable in Indonesia. With a minimum deposit of Rp.20,000 to reach all gambling players in Indonesia in order to play all the games available on ProQQ. If you need help with a deposit fund transaction service and withdraw funds and other complaints, then you can contact our 24 hour non-stop online customer service who is ready to provide the best service for you.

    Agen Poker Online

    ReplyDelete
  22. agenwin is an online gambling agent that becomes a soccer gambling agent and casino agent by providing soccer gambling, online casino, sbobet soccer betting with the best server and easy to play via your mobile or smartphone. agenwin has collaborated with several Indonesian local banks such as BCA, BRI, Indonesian and independent to improve service in the deposit and withdrawal process.
    agen bola terpercaya

    ReplyDelete
  23. Welcome to .pihakqq.net, the Best and Most Trusted Indonesian Online Poker Site. AsQQQ provides 6 games that can be played in 1 User Id only. Online Poker, DominoQQ, Bandar Ceme, Capsa Susun, Live Poker, Ceme Keliling Games, using Indonesian real money
    poker online

    ReplyDelete
  24. JudiKartu is the jadwal bola, first trusted online betting agent in Indonesia that provides live baccarat, roulette and sicbo online services. Giving customer satisfaction and serving better than others.
    Always determined to be able to serve customers better. Trying to remain a Soccer Agent, Casino Agent, the best and most trusted Online Betting in Indonesia
    Jadwal bola

    ReplyDelete
  25. Malaikatpoker is the Most Trusted Judi Poker Online Site in Indonesia. Malaikatpoker is one of the websites of Poker Online, domino qq and the most trusted Ceme airport in Indonesia. domino qiu-qiu online with our friendly and professional customer service, 24 hours standby on livechat for you. For us Faithful Members are Kings. Brave Angel Guarantees 100% Security of Member Data and guarantees 100% players vs. players. When other agents expect you to lose, Angelpoker expects you to WIN. Online poker players can enjoy poker online uang asli games that we provide.

    poker uang asli

    ReplyDelete
  26. Zammora is an Online Store that was established in 2017, providing fashion products for women. We are focused on the beauty of design, and we are obsessed with quality.

    tas wanita

    ReplyDelete
  27. You can chat, video call, phone, view photos, have fun, and even meet!
    online datingsite, online dating indonesia, free online dating, best online dating site free, online dating app, online dating terbaik, dating online chat, situs online dating, free dating sites without payment, dating online with video call, dating, meet me, meet, people nearby, soulmate, heart, online dating apps, free online dating, video call, audio chat, find your partner, setipe, skout, flurv, bigo live, Tinder, OkCupid, Hookup, BeeTalk
    online dating site

    ReplyDelete
  28. Search engine optimization (SEO) or Indonesian SEO is the process of influencing the visibility of websites or web pages in search engine results - often referred to as "natural", "organic" or "earned" results. In general, the earlier (or rank higher on search results pages), and more often sites appear in the list of search results, the more visitors will receive from search engine users, and these visitors can be converted to customers.
    SEO can target various types of searches, including image search, local search, video search, academic search, news search and industry-specific vertical search engines.

    Indonesian SEO

    ReplyDelete
  29. Specialist SEO.com is an Indonesian SEO Service launched in 2011 when search engines were in the early stages of developing their algorithms, Google was a big company that was very promising. Search engine optimization (SEO) has a completely different meaning. Since then many things have changed and internet marketing has become a necessity for every company that wants to survive in the online world competitively.
    Specialist SEO Indonesia SEO Services deal with Web Marketing technology from the start. After hours of research and development, trial and error, we can now offer the most reliable solutions in the world of Digital Marketing.

    Indonesian SEO Service

    ReplyDelete
  30. Dompetpoker.org is a card game that shares betting rules and is usually (but not always) in hand ranking. The Poker Online game is different in terms of how cards are shared. In the most modern Poker Games, the first round of betting starts with several forms. Type of card arrangement in Online Poker.

    poker online

    ReplyDelete
  31. Hello there. I found your web site by the use of Google at the same time as searching for a comparable subject, your site came up. It seems great. I have bookmarked it in my google bookmarks to come back then.

    Telugu Status
    Telugu Whatsapp Video Status
    WhatsApp Video Status in Telugu
    Telugu Status Video
    Telugu Status Video Songs Download
    Telugu Status Video Songs Download
    Malayalam Status Video Songs Download

    ReplyDelete
  32. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work.

    ReplyDelete
  33. Wonderful article I really appreciate your article thanks for sharing with us. We are Emergency Dentist Ottawa service provider, Thanks

    ReplyDelete
  34. thanks for sharing it is very helpful
    http://www.onlineservices.pk/

    ReplyDelete
  35. I’m keen on this post, enjoyed this one thank you posting . USA News Today

    ReplyDelete
  36. My friend first found your blog on Google and she referred your blog to me . yacht charter turkey

    ReplyDelete
  37. You should get involved in a contest for example of the most useful blogs on-line. Let me recommend this page! Judi BandarQ

    ReplyDelete
  38. The cell phone swap search products in addition to services manufactured a method at what time is definitely technically state-of-the-art however trouble-free since well in view of the fact that absolutely fast with the aim of achieve splurge of. face shave Salt Lake City


    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    pretty practical stuff, overall I consider this is worth a bookmark, thanks Situs DominoQQ Online

    ReplyDelete
  39. WOW!!!! I never thought it would be possible for a matured wealthy woman to make a calculator this easy. Honestly, I think this is one of the easiest guide online. Thank you.

    ReplyDelete
  40. Thanks for sharing this quality information with us. I really enjoyed reading.
    return man 3

    ReplyDelete
  41. Howdy! I just wish to give a huge thumbs up for the great info you might have here on this post. I will probably be coming back to your weblog for more soon. Dab Nail

    ReplyDelete