C++ GUI: Simple Calculator App | WinForms

Поділитися
Вставка
  • Опубліковано 11 вер 2024
  • In this video, we will discuss how to make a simple calculator using the arithmetic operations in c++ language. We will use the knowledge from the previous videos to build up the basic UI of this application. We will be using Windows Forms to build the application.
    Since the template for this application is not provided by Visual Studio by default, we will have to make it on our own.
    For this, you may follow this video: • C++ GUI: Simple Hello ...
    We will make a simple UI using labels, textboxes, and buttons. To learn more about,
    Labels: • C++ GUI: Simple Hello ...
    TextBoxes: • C++ GUI: Textboxes and...
    Buttons: • C++ GUI: Buttons and U...
    First we will make the UI in the form of a simple calculator using buttons for the Arithmetic/Mathematical Functions. Next, we will program those buttons to do the certain tasks like Addition, Subtraction, Multiplication and Division. You can also modify this application to perform more scientific tasks too, by referring the C++ documentation and finding necessary libaries for scientific math.
    This series is a complete series for C++ programmers who already have the basic knowledge of C++ Principles. Anyhow, you may be able to follow this tutorial, however, you are required to have some experience in writing simple programs.
    If not, I highly encourage you to take a look at the basic principles first rather than jumping right into this series.
    You can use the UA-cam Videos, or if you are in love with my tutorials so much(I mean why not?), you can leave a comment and I will try to make the best I can.
    You can watch the entire series from here : • C++ GUI: Simple Hello ...
    Download Main.cpp : www.cyberweb.ga/main.cpp
    ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼
    🎁Support us on Patreon ----- / sciber
    ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼
    #CMTAV #Programming #GUI
    ==========================================
    Visit Us : www.cyberweb.ga
    Follow us on Instagram : cybercafesl
    Follow me on Instagram (personal) : this_is_malindu
    Personal Facebook : / malindu.dilanka
    Like us on Facebook : / cybercafesl
    Join our Facebook group : / programmingsrilanka
    ==========================================
    |||TAGS (IGNORE)|||
    C++ GUI Calculator,windows forms application c++,arithmetic operations in c++,simple calculator in visual studio,calculator in c++,c programming,calculator,simple calculator in c++ using if else,design a basic calculator,how to make a calculator in c++ programming,vb.net project,add numbers in c++,graphical programming,graphical user interface,programming,arithmetic operations on functions,cybercafe programming,cybercafe c++,cybercafe gui
  • Наука та технологія

КОМЕНТАРІ • 49

  • @neptub665
    @neptub665 4 роки тому +9

    Thank You so much for the help! I have been looking for tutorials on this topic for so long so I gave up. I wanted to start programming again and that is when I found your tutorials. You are a lifesaver. Thank you so much... I subbed!

    • @wearesciber
      @wearesciber  4 роки тому +1

      Wow man, thanks for those nice words

    • @pactube8833
      @pactube8833 3 роки тому

      @@wearesciber dude I'm looking for a calculator which can receive infinite inputs

    • @wearesciber
      @wearesciber  3 роки тому

      @@pactube8833 that is a bit complex, yet possible. I will make a tutorial at some point.

  • @unrealengineruseng9583
    @unrealengineruseng9583 3 роки тому +6

    Hey. Thank you. I do not speak English well. But your lessons are very interesting and understandable for me. Very short and understandable !!! You are the best )))

    • @wearesciber
      @wearesciber  3 роки тому +1

      Thanks a lot for your awesome feedback 👊

  • @qigao5458
    @qigao5458 3 роки тому +2

    Step by step, great!

  • @ngocduyle7409
    @ngocduyle7409 2 роки тому +1

    thanks you!
    from Vietnam

  • @abdurahmonov3513
    @abdurahmonov3513 3 роки тому +2

    Thank You for such good videos.

  • @cjeeckazad2995
    @cjeeckazad2995 4 роки тому +1

    that is really good for me
    thanks 😊

  • @ThatUnknownDude_
    @ThatUnknownDude_ 2 роки тому +1

    How to make it so that rather than typing in the numbers, we press a button and then the number comes in the result box, then we type in another number and that number gets appended to the result box... kind of like in modern calculators...

    • @wearesciber
      @wearesciber  2 роки тому +1

      Nice Idea, should probably make a video on that too! Thanks.

  • @secrethoudini1621
    @secrethoudini1621 3 роки тому +1

    This helped me out a lot, but is it possible to round up the answer? For example I divide 1 by 3 and get 0.3333333... is it possible to round it to just 0.33?

  • @Tout-Le-Monde02
    @Tout-Le-Monde02 3 роки тому +1

    The Winforms is not available anymore in Visual Studio 2019. Whatever you are showing here has already been made obsolete by Microsoft.

    • @wearesciber
      @wearesciber  3 роки тому +1

      Yeah I agree, but it has some use

  • @box-ce7ng
    @box-ce7ng Рік тому

    thank you very much :D

  • @mircrashjsh
    @mircrashjsh 4 роки тому +1

    thank you

  • @AbdulRahim-rw5pk
    @AbdulRahim-rw5pk Рік тому

    What if we put an letter in there the program might be crash

  • @davidanwar6996
    @davidanwar6996 4 роки тому +1

    Very Nice

  • @knachoo
    @knachoo 3 роки тому

    In this case, you are performing all the operations in the header file. What if I want to perform the operations in the cpp source file and then modify the label value? How do I do that? I am always getting an error that the label is not accessible.

    • @wearesciber
      @wearesciber  3 роки тому

      Good question, could even do a video about it.
      The problem here is that the label is marked private in the header file, hence you can't access it in other files. So perhaps you could change the label to public. Or another better idea would be to make a public method and call it to modify the label.

  • @salmazakaria9368
    @salmazakaria9368 4 роки тому +1

    Please can you tell us how to convert it to string instead of integer?

    • @wearesciber
      @wearesciber  4 роки тому

      To convert anything to string use the system.convert.tostring method

  • @Ivan-bh9cw
    @Ivan-bh9cw 2 роки тому

    Thanks a lot

  • @m.muzammilbabar4375
    @m.muzammilbabar4375 4 роки тому +1

    Hey, it was very helpful for me. However i have a question.
    How could we use source file as we use in console application?
    Actually i want to process the string

    • @wearesciber
      @wearesciber  4 роки тому +1

      You mean like, you want to do stuff in the main form? Well, in most cases you don't. But there are instances you may. We'll get you through them.
      If this is not what you expected, please explain to me. 😊

    • @m.muzammilbabar4375
      @m.muzammilbabar4375 4 роки тому

      Actually i want to take the input from the user and than in the source file i want to convert the string into hexa-decimal (I have already written this code, now i only need to do is to do it with gui) and other stuff like this.
      Kindly give me some links so that i can understand that how could i use it.

    • @wearesciber
      @wearesciber  4 роки тому +1

      Thats easy. The difference is you will do in the header file. Just use the same code in the header file.

    • @m.muzammilbabar4375
      @m.muzammilbabar4375 4 роки тому

      @@wearesciber Thank you! Lots of Love

  • @davidanwar6996
    @davidanwar6996 4 роки тому +1

    Yess..... thank you

  • @unleashedproductions2615
    @unleashedproductions2615 Рік тому

    My code is running the previous application of Hello world on debug.

  • @defan5732
    @defan5732 Рік тому

    Hi is there a way to get the header file to call a cpp file so I can just write the code in cpp an bring the result onto the UI? Thanks.

    • @wearesciber
      @wearesciber  Рік тому

      I don't really understand your question, but if what you are saying is possible in general C++, then it should work here too.

    • @defan5732
      @defan5732 Рік тому

      @@wearesciber sorry what I meant was could I write a function in cpp then when I press a button on the ui run that cpp function?

    • @wearesciber
      @wearesciber  Рік тому

      Of course.
      You can do it like this.
      Say the function is located in function.cpp
      Make function.h and add function signature.
      Then include the header file inside myform.h
      Then call your function.

    • @defan5732
      @defan5732 Рік тому +1

      @@wearesciber Great thank you. Also amazing videos by the way really appreciate it :)

    • @wearesciber
      @wearesciber  Рік тому

      Glad you enjoyed ;)

  • @dojitha2722
    @dojitha2722 4 роки тому +1

    👌👌👌

  • @zk6239
    @zk6239 2 роки тому

    Sir how to use the app in other pc like setup and installation?

    • @wearesciber
      @wearesciber  2 роки тому

      ua-cam.com/users/shortsGEUMSkAHqGw
      or for a more comprehensive guide
      ua-cam.com/video/p3AmoAP71U0/v-deo.html

  • @jhonathwensenbermejiagonza2954

    hello excelent!! how use the function pow?

    • @wearesciber
      @wearesciber  Рік тому +1

      yes you can add another button for the power function and use the second textbox as the index.
      5 ^ 3 = 125
      5 is the first textbox
      ^ is the operation like addition subtraction
      3 is the index/power
      125 is the answer
      just make an event handle for another button and in there use the power function as usual by using the numbers from the textboxes as parameters.

  • @zawadhossain6264
    @zawadhossain6264 3 роки тому

    But how to export it as as .exe file?

    • @wearesciber
      @wearesciber  3 роки тому

      It is available in solution folder

  • @tobiaskarl4939
    @tobiaskarl4939 3 роки тому

    I see a white web side when I go to www.cyberweb.ga
    and you do not have a ssl certificate. You can get a free one from "Let's encrypt".

    • @wearesciber
      @wearesciber  3 роки тому

      Thanks dude... btw, cyberweb.ga is not maintained anymore, the new website is www.sciber.ml
      👊❤