How to Make a Calculator in C# Windows Form Application Part-2

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ส.ค. 2014
  • Source code - www.codebind.com/c-sharp/make-...
    ★★★Top Online Courses From ProgrammingKnowledge ★★★
    Python Programming Course ➡️ bit.ly/2vsuMaS ⚫️ bit.ly/2GOaeQB
    Java Programming Course ➡️ bit.ly/2GEfQMf ⚫️ bit.ly/2Vvjy4a
    Bash Shell Scripting Course ➡️ bit.ly/2DBVF0C ⚫️ bit.ly/2UM06vF
    Linux Command Line Tutorials ➡️ bit.ly/2IXuil0 ⚫️ bit.ly/2IXukt8
    C Programming Course ➡️ bit.ly/2GQCiD1 ⚫️ bit.ly/2ZGN6ej
    C++ Programming Course ➡️ bit.ly/2V4oEVJ ⚫️ bit.ly/2XMvqMs
    PHP Programming Course ➡️ bit.ly/2XP71WH ⚫️ bit.ly/2vs3od6
    Android Development Course ➡️ bit.ly/2UHih5H ⚫️ bit.ly/2IMhVci
    C# Programming Course ➡️ bit.ly/2Vr7HEl ⚫️ bit.ly/2W6RXTU
    JavaFx Programming Course ➡️ bit.ly/2XMvZWA ⚫️ bit.ly/2V2CoAi
    NodeJs Programming Course ➡️ bit.ly/2GPg7gA ⚫️ bit.ly/2GQYTQ2
    Jenkins Course For Developers and DevOps ➡️ bit.ly/2Wd4l4W ⚫️ bit.ly/2J1B1ug
    Scala Programming Tutorial Course ➡️ bit.ly/2PysyA4 ⚫️ bit.ly/2PCaVj2
    Bootstrap Responsive Web Design Tutorial ➡️ bit.ly/2DFQ2yC ⚫️ bit.ly/2VoJWwH
    MongoDB Tutorial Course ➡️ bit.ly/2LaCJfP ⚫️ bit.ly/2WaI7Ap
    QT C++ GUI Tutorial For Beginners ➡️ bit.ly/2vwqHSZ
    ★★★ Online Courses to learn ★★★
    Get 2 FREE Months of Unlimited Classes from skillshare - skillshare.eqcm.net/r1KEj
    Data Science - bit.ly/2lD9h5L | bit.ly/2lI8wIl
    Machine Learning - bit.ly/2WGGQpb | bit.ly/2GghLXX
    Artificial Intelligence - bit.ly/2lYqaYx | bit.ly/2NmaPya
    MERN Stack E-Degree Program - bit.ly/2kx2NFe | bit.ly/2lWj4no
    DevOps E-degree - bit.ly/2k1PwUQ | bit.ly/2k8Ypfy
    Data Analytics with R - bit.ly/2lBKqz8 | bit.ly/2lAjos3
    AWS Certification Training - bit.ly/2kmLtTu | bit.ly/2lAkQL1
    Projects in Java - bit.ly/2kzn25d | bit.ly/2lBMffs
    Machine Learning With TensorFlow - bit.ly/2m1z3AF | bit.ly/2lBMhnA
    Angular 8 - Complete Essential Guide - bit.ly/2lYvYRP
    Kotlin Android Development Masterclass - bit.ly/2GcblsI
    Learn iOS Programming Building Advance Projects - bit.ly/2kyX7ue
    ★★★ Follow ★★★
    My Website - www.codebind.com
    DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
    Windows 8 Simple Calculator sample in C# for Visual Studio
    Visual Studio WinForm Windows Calculator Tutorial
    Sample Calculator with windows form application in c#
    Creating a Calculator Visual Studio C#
    Calculator in C# (Windows Application)
    how to create calculater in window application with c#
    A Calculator using C#
    Simple Calculator in C#
    Creating A Calculator Using Windows Form Application
    Make simple calculator in c# windows form application
    calculator code in c# windows form application
    calculator program in c# using windows forms
    window form application in c#

ความคิดเห็น • 196

  • @enihgilead1427
    @enihgilead1427 6 ปีที่แล้ว +7

    'Tis the best tutorial I found... after a long, long search on the net! Congratulations, bro, for sharing; helped a lot!

  • @RaiseOfMaster
    @RaiseOfMaster 3 ปีที่แล้ว +3

    Hi,
    Thank you so much for this tutorial,
    But I have got a problem: when I do 1+5 then click equal (=) and then do any operation instead of doing the 6 with any other number it makes the 12.
    Please Help!

  • @madjayhawk
    @madjayhawk 7 ปีที่แล้ว +1

    I haven't finished it yet but will. It is working perfectly so far.
    Thank you for taking the time to produce this for us newbies. It really helps me to see how a practical problem is put together.

    • @ledizzy2634
      @ledizzy2634 ปีที่แล้ว

      Have you finished it now?

  • @anilgolakiya
    @anilgolakiya 6 ปีที่แล้ว

    sir can you tell me using key handling event for calculator.
    I know there are three type of key handling like key press, key down and key up . so how can i use in calculator.....

  • @adrianv.1636
    @adrianv.1636 4 ปีที่แล้ว

    Great videos!! Thank you sir for your awesome explanation, I followed every step and I have my calculator working 100%! Thanks

  • @Nate-bl9hy
    @Nate-bl9hy 8 ปีที่แล้ว

    Great job. Thank you very much for making these two videos

  • @TrungNguyen-ti7ru
    @TrungNguyen-ti7ru 5 ปีที่แล้ว

    Hi all, when i do division by zero, how do i catch an exception in this case? Thanks!

  • @elunatsciencetime
    @elunatsciencetime 9 ปีที่แล้ว +4

    it really helps me tnx bro

  • @kanchanamedapati6416
    @kanchanamedapati6416 8 ปีที่แล้ว

    Thank you. These two video's were very helpful .

  • @Santino3344
    @Santino3344 4 ปีที่แล้ว

    Good night and how do I go to store me every number stored on the label for example 2 + 2 + 2 +2 +4 + 5 just like windows does thanks in advance.

  • @papiabiswas5633
    @papiabiswas5633 3 ปีที่แล้ว

    Very effective video. It helped me a lot to finish my assignment. Thank you so much for the nice video.

  • @aakashakku5
    @aakashakku5 3 ปีที่แล้ว +3

    Thank you SIR. Hope I become good in programming.

  • @osher3949
    @osher3949 2 ปีที่แล้ว +1

    Hey i did everything like the video but its like not updating whenever im running the program?
    what can i do ?

  • @salaryunis2254
    @salaryunis2254 4 ปีที่แล้ว

    Thank you for this useful project, very clear explanation Sir!

  • @maryamafzal6948
    @maryamafzal6948 5 ปีที่แล้ว

    sir my . and any operator are not working along with each other means if i like to add 3.3+2 then complier shows error before writing '2'
    or 2.3+ error
    5.6* error
    1.1- error
    ...
    so how to recover it?

  • @ninamohamed490
    @ninamohamed490 3 ปีที่แล้ว +1

    Hey I'm at 10:43 and I've followed every little detail and I checked twice still my label idk why is showing the word label 1 after I ran it and it shows nothing else and when I click + or any other Operation it doesn't work , plz help

  • @bahy66
    @bahy66 9 ปีที่แล้ว +12

    please do this 0 - 6 - 5 or 0 * 5 * 3 it will be error how to treat.

  • @MusicAfterDeath
    @MusicAfterDeath 8 ปีที่แล้ว

    Thanks, easy to follow and works!

  • @juliusgloapelegrino8540
    @juliusgloapelegrino8540 9 ปีที่แล้ว +1

    Thank you bro ! Help so much.

  • @RahulKumarRajendran
    @RahulKumarRajendran 9 ปีที่แล้ว

    Thank you so much........... very much informative and interesting.

  • @klaudiamueller5600
    @klaudiamueller5600 9 ปีที่แล้ว

    Well done, ProgrammingKnowledge. Well explained and this lesson is a very good basic to go forward in programming in C#

    • @thewatcher1776
      @thewatcher1776 7 ปีที่แล้ว

      Klaudia Mueller please learn the basics first (operarors, datatypes, variables definition, scopes, oop, design patterns) then you'll see the right way...

  • @RRV535
    @RRV535 7 ปีที่แล้ว

    A lot of codes! Thank you for this! Subscribed

  • @setonmautin7630
    @setonmautin7630 4 ปีที่แล้ว

    Please can you explain why my decimal is not responding to the oerator.. eg. 2.5 + or any other operator keep crashing,,i get a message with input string was not in a correct format

  • @csstudent355
    @csstudent355 ปีที่แล้ว

    Your video helped me a lot about my homework. Thank you.

  • @Moffe1A4
    @Moffe1A4 8 ปีที่แล้ว +32

    Hey!
    Very good and helpful tutorial.
    I just want to add something i had a problem with.
    I always get this exception error when i try to use decimal numbers!
    "An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll"
    how i fixed this was very simple. Change the text "." that represent a comma in your design form to a ",".
    and make sure to change the "." in your comma handler to "," too i.e the if statement.
    Thanks again :)

    • @Arghandevol
      @Arghandevol 6 ปีที่แล้ว

      Mohammed Al-Jumaili I have same problem. That not solved my problem. Weird

    • @EmrikWan
      @EmrikWan 5 ปีที่แล้ว

      Thanks my dude, I was getting really confused for a second there.

  • @rahadulhaq6387
    @rahadulhaq6387 3 ปีที่แล้ว

    Thank you so so very much
    That was really very easy to understand as a beginner❤❤

  • @tanjibontu6656
    @tanjibontu6656 4 ปีที่แล้ว

    Thank you so much. You really teach so well.

  • @MarakamiSG
    @MarakamiSG 8 ปีที่แล้ว

    Praise you for making this.

  • @shanukapeiris7618
    @shanukapeiris7618 7 ปีที่แล้ว

    Good to learn. i enjoyed.Thank you

  • @nakaharaaki6486
    @nakaharaaki6486 3 ปีที่แล้ว

    When i tried to follow this tutorial then i found a little issue. When i created the bool then i could not use number-buttons cuz they were not working and nothing appeared in textbox. To mąkę it appear i had to add to instruction for number-buttons "if" phrase "isoperationperformed = true".
    Then i could not use numbers like 10 or something like that cuz only one number appeared like: when i wanted to write 12 then IT appeared like 1 and then changed on 2.

  • @SPECIAL_OPS_G17
    @SPECIAL_OPS_G17 2 ปีที่แล้ว

    superb. it's really great
    and you teach easily

  • @preventsmanagement8539
    @preventsmanagement8539 9 ปีที่แล้ว

    hey......
    super...... i like it... its realy working... thank you so much
    :)

  • @UsmanKhan-ny6bu
    @UsmanKhan-ny6bu ปีที่แล้ว

    very smooth knowledge but i want to ask one thing..
    when we perform the operation the result value goes into the label box.. but when we do more calculations.. the label box just showing the first result and current operation.

  • @user-uc7lk5tn2c
    @user-uc7lk5tn2c 6 ปีที่แล้ว +2

    Very helpful to me. Thank you so much for making this video.
    Just one comment:
    If we press the equate button and want to continue to press an operator button. It will "performClick" the equate button again.
    So, I suppose to add one line at 18:16:
    if (labelCurrentOperator.Text != "") // The label shows something, which means the last action is not pressing the equate button.
    button15.performClick();

  • @dcrdcrnkl1
    @dcrdcrnkl1 7 ปีที่แล้ว

    Thanks so much it really helped me

  • @aeternae1646
    @aeternae1646 6 ปีที่แล้ว

    how to make it so if any button is clicked after equals to the textbox is cleared

  • @anileybekele
    @anileybekele 8 ปีที่แล้ว

    good job, appreciate it can do substring, to cancel each number

  • @computerfreak696
    @computerfreak696 5 ปีที่แล้ว

    Great video! Thank you very much!

  • @johnyshow9349
    @johnyshow9349 6 ปีที่แล้ว

    Thank you very much !!1 this video is a realy good!

  • @nordxdelis2672
    @nordxdelis2672 9 ปีที่แล้ว

    thank yo uso much. i have completed the tutorial and it goes very fine.. its kind of nosebleeding hahaha

  • @myself8709
    @myself8709 2 ปีที่แล้ว

    Thncs for this label statement it is really working..i was fixing it since yesterday

  • @tomknott2315
    @tomknott2315 5 ปีที่แล้ว

    What a great tutorial...You are awesome...

  • @knalsgtes6684
    @knalsgtes6684 5 ปีที่แล้ว +3

    Hi Sir, the problem is that after clicking the plus(+) operator and then click the equal(=) operator it doubles the value :(

    • @Tbm4545
      @Tbm4545 ปีที่แล้ว

      Ya thats how the actual calculator works. Go and cehck

  • @maedevaezi4428
    @maedevaezi4428 4 ปีที่แล้ว

    Really helpful
    Clear and good

  • @johnwayne3152
    @johnwayne3152 9 ปีที่แล้ว

    Sir can you make a Netbeans version of this? or do you have one?

  • @januar2438
    @januar2438 4 ปีที่แล้ว

    Please help me. when I press a character other than + it always points to +. is there any solution?

  • @midhushan3006
    @midhushan3006 6 ปีที่แล้ว

    nice video its very use fully thank you very much.

  • @helucz4772
    @helucz4772 6 ปีที่แล้ว

    Thanks So much for this 2 Awesome helpful videos it seriously helped me alot do my own calculator and
    from now ill use my own calc instead of the normal one! also my friends were surprised Thanks!

    • @sudheerb4919
      @sudheerb4919 6 ปีที่แล้ว

      very informative n useful for beginners thank you so much

  • @acershhap
    @acershhap 8 ปีที่แล้ว

    Dude thank you so much you are the best :)

  • @nandlalprasad4918
    @nandlalprasad4918 7 ปีที่แล้ว

    hey it's throwing the error at = button
    please suggest me on this

  • @lalitchavan6972
    @lalitchavan6972 5 ปีที่แล้ว

    Great !!! Thanks 4 d tutorial !

  • @spitfire3280
    @spitfire3280 3 ปีที่แล้ว +4

    Great tutorial! Very clear, logical and easy to follow.

    • @coderdhruv
      @coderdhruv ปีที่แล้ว

      Go to #coderdhruv

  • @e_g7788
    @e_g7788 5 ปีที่แล้ว

    How to change decimal notation form (,) to (.)?

  • @MuhammadHamza-vd2yz
    @MuhammadHamza-vd2yz 5 ปีที่แล้ว

    Very helpful
    thanks.

  • @henrixsalenga7173
    @henrixsalenga7173 8 ปีที่แล้ว

    if you may consider this request can you make tutorial for change password with database

  • @dipeekathakur6446
    @dipeekathakur6446 5 ปีที่แล้ว

    I make this program or form i coded the same but it is giving me 5 errors that cannot implicitly convert type string to bool and cannot implicitly convert type char to string...
    Plzzz help me

  • @AnimalForce77
    @AnimalForce77 9 ปีที่แล้ว

    thank you helped me so much cause I such a noob

  • @ShivaniRajput-uz1eu
    @ShivaniRajput-uz1eu 2 ปีที่แล้ว

    thank you... it's really helpful

  • @BarbarosYurttagul
    @BarbarosYurttagul 10 ปีที่แล้ว

    Can you help pls? I did this in java/netbeans. It works but in textfield, it shows the results as always double value. For example 2+3= 5.0 What can I do to fix this?

    • @mohammedxayo5155
      @mohammedxayo5155 5 ปีที่แล้ว +1

      when you declare the Variable make his data type integer or int

  • @sJungbert
    @sJungbert 8 ปีที่แล้ว

    great tutorial !

  • @FernandoArceOfficial
    @FernandoArceOfficial 9 ปีที่แล้ว

    Thank you very much.

  • @reinie6279
    @reinie6279 5 ปีที่แล้ว

    Nice tutorial, thank you.
    I converted this Form app into a WPF app (with XAMLcode) successfully (its slightly different).
    Next step is to implement the keypad using this app (works much faster).

    • @khingkhing7085
      @khingkhing7085 2 ปีที่แล้ว

      so did you do successfully implement it ?

  • @nangialainoorzai3497
    @nangialainoorzai3497 5 ปีที่แล้ว

    very thanks dear man
    Allah bless you

  • @Xxfireflame27xX
    @Xxfireflame27xX 5 ปีที่แล้ว +1

    not sure why, but it will not let me use the code "button.text"
    just wont work no explanation, everything is exactly identical to his code. Anyone know?

    • @erdelysimon
      @erdelysimon 4 ปีที่แล้ว

      Because it's button.Text

  • @GusioonYt
    @GusioonYt 2 หลายเดือนก่อน

    Thank you brother!

  • @sinonghean4274
    @sinonghean4274 9 ปีที่แล้ว

    Please help me. Result error when 3+3+5-1*6

  • @Uragan93
    @Uragan93 5 ปีที่แล้ว

    But it dosen't work, everytime i want to do for example 9*9 it works but after that it just goes crazy if i pun another *
    I get 81^2 and so on.

  • @mahamedaamiincllahiibrahim6570
    @mahamedaamiincllahiibrahim6570 5 ปีที่แล้ว

    techer you are best techer

  • @saravanankiruba5521
    @saravanankiruba5521 6 ปีที่แล้ว

    really its good
    but how can i use in another system

  • @joeymoreau8478
    @joeymoreau8478 5 ปีที่แล้ว

    Bro you my new hero

  • @lordev8956
    @lordev8956 9 ปีที่แล้ว +1

    thank you! u helped me so much!!!

    • @creatur
      @creatur 3 ปีที่แล้ว

      What you are doing now... If active

  • @khanriza
    @khanriza 7 ปีที่แล้ว

    Thank you!

  • @mprof4478
    @mprof4478 6 ปีที่แล้ว

    wow thank you so much!

  • @danield6086
    @danield6086 3 ปีที่แล้ว

    Thanks bro.Good Job. Keep so on...

  • @Illum1ne
    @Illum1ne 6 ปีที่แล้ว

    dude you have a Notepad? i liked ur tutorial videos.

  • @mirzaahmadsaeedbaig5798
    @mirzaahmadsaeedbaig5798 8 ปีที่แล้ว

    .clear is not available in my library. How I can get?

  • @ayexu6914
    @ayexu6914 2 ปีที่แล้ว

    Very helpful thanks! :D

  • @AnaAna-ju3lt
    @AnaAna-ju3lt 8 ปีที่แล้ว

    Thank you for helping me do my homework :))

    • @FreddesGCH
      @FreddesGCH 8 ปีที่แล้ว

      +Chichernea Anamaria I agree

  • @hasanaslan2688
    @hasanaslan2688 4 ปีที่แล้ว +2

    Thank you for your work. But there is a problem. You didn't add anything about multiple operations. For example; 12+12=24 but when we get this result, we can click at another number button to continue addition. But at this work, we can't get the exact numbers for the multi operation

    • @ravipala8087
      @ravipala8087 2 ปีที่แล้ว

      Yes bro .same prblem

  • @adrianocelio5974
    @adrianocelio5974 7 ปีที่แล้ว

    thank you!

  • @arvindavedavid5843
    @arvindavedavid5843 8 ปีที่แล้ว

    decimal point does nt work?

  • @m.s6779
    @m.s6779 3 ปีที่แล้ว

    thank you for this tutorial

  • @dipsikharath8782
    @dipsikharath8782 5 ปีที่แล้ว

    u r really superb!!!!

  • @shirinmz7909
    @shirinmz7909 4 ปีที่แล้ว

    خيلي خوب بود سپاس

  • @devdutmn9608
    @devdutmn9608 6 ปีที่แล้ว

    Thx a lot !!

  • @pakgeochannel8419
    @pakgeochannel8419 5 ปีที่แล้ว

    jesa TV ke screen par logo working kar tea hai vo coding software kase banea gea ose kea coding kea hai

  • @rena1826
    @rena1826 4 ปีที่แล้ว +7

    Great tutorial, helped me with some of my problems !
    But when i click 3+3 = *display* 6 but when i click + again, it straight away adds the 6 which display 12 (*3 + 3 + 6*). It does not allow me to input a 2nd number .

    • @abdullahajeebi
      @abdullahajeebi 2 ปีที่แล้ว

      Same

    • @isak1496
      @isak1496 2 ปีที่แล้ว

      @@abdullahajeebi same, u found a solution yet?

    • @lukechopper22
      @lukechopper22 2 ปีที่แล้ว

      Try this solution, making sure to ignore the ‘InitializeComponent’ method as it is almost definitely going to be incompatible with the components on your calculator’s own GUI in addition to taking the time to rename the relevant methods - i.e., ‘button5_Click’, ‘button6_Click’, ‘button16_Click’, etc. - so that they match up with the corresponding names of the click event listeners that you have previously endowed your own button components with:
      pastebin.com/raw/1B9AFkkT

    • @ilikecod4584
      @ilikecod4584 ปีที่แล้ว +2

      i just added "resultValue = 0;" at the end of the code under "labelCurrentOperation.Text = "";" and it worked fine.

    • @kerel4417
      @kerel4417 ปีที่แล้ว

      @@ilikecod4584 Dude you are ultra fucking legendary, you fixed it for me

  • @mounikakavuri5492
    @mounikakavuri5492 4 ปีที่แล้ว +1

    sir please i want program clearly .u should do a gdd job

  • @mma2457
    @mma2457 5 ปีที่แล้ว

    very nice..please keep some explanation...

  • @narminsky
    @narminsky 5 ปีที่แล้ว

    thank you very very very much

  • @ismotoivonen7911
    @ismotoivonen7911 7 ปีที่แล้ว +1

    When I'm following your code example, I crash into problems with some commands.
    There is something wrong with operator_click because when I try to use your example, it just doesn't work should.
    For example trying to write operationReady = button.Text it doesn't accept it. I have to write button.Content. And maybe that causes some problems, because at least calculator doesn't work as should? Switch is not working either, even I've coded it exactly like you did. So maybe currentOperationLabel doesn't get right values from those variables? And when reading that currentOperationLabel like .text, it doesn't work, and I have to do it again by .Content, and maybe that affects to switch somehow? Only thing that works is adding. (even operation label doesn't show the information right). Other operations doesn't work at all.

  • @kunal9999100
    @kunal9999100 7 ปีที่แล้ว

    Thanks A Lot !!

  • @Sofoklesmaniac
    @Sofoklesmaniac 8 ปีที่แล้ว +1

    Great job! But what's that background sound though? Sounds like a hair dryer lol.

  • @hansisenavirathne9670
    @hansisenavirathne9670 ปีที่แล้ว

    Thank you

  • @leonardjjf
    @leonardjjf 9 ปีที่แล้ว

    Good, thanks.

  • @Dotto19
    @Dotto19 3 ปีที่แล้ว

    Thank you brother

  • @patricksarrosa
    @patricksarrosa 4 ปีที่แล้ว

    thank you sir!

  • @levanimelikishvili5912
    @levanimelikishvili5912 9 ปีที่แล้ว

    ty bro its rly works :)

  • @almersaladv2328
    @almersaladv2328 2 ปีที่แล้ว

    Thanks man your smart

  • @itk3259
    @itk3259 3 ปีที่แล้ว

    Very helpful