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 - Наука та технологія
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!
Wow man, thanks for those nice words
@@wearesciber dude I'm looking for a calculator which can receive infinite inputs
@@pactube8833 that is a bit complex, yet possible. I will make a tutorial at some point.
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 )))
Thanks a lot for your awesome feedback 👊
Step by step, great!
thanks you!
from Vietnam
Thank You for such good videos.
that is really good for me
thanks 😊
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...
Nice Idea, should probably make a video on that too! Thanks.
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?
Yes there are libraries ☺
The Winforms is not available anymore in Visual Studio 2019. Whatever you are showing here has already been made obsolete by Microsoft.
Yeah I agree, but it has some use
thank you very much :D
thank you
What if we put an letter in there the program might be crash
Very Nice
😀💪
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.
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.
Please can you tell us how to convert it to string instead of integer?
To convert anything to string use the system.convert.tostring method
Thanks a lot
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
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. 😊
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.
Thats easy. The difference is you will do in the header file. Just use the same code in the header file.
@@wearesciber Thank you! Lots of Love
Yess..... thank you
😀💪
My code is running the previous application of Hello world on debug.
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.
I don't really understand your question, but if what you are saying is possible in general C++, then it should work here too.
@@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?
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.
@@wearesciber Great thank you. Also amazing videos by the way really appreciate it :)
Glad you enjoyed ;)
👌👌👌
Sir how to use the app in other pc like setup and installation?
ua-cam.com/users/shortsGEUMSkAHqGw
or for a more comprehensive guide
ua-cam.com/video/p3AmoAP71U0/v-deo.html
hello excelent!! how use the function pow?
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.
But how to export it as as .exe file?
It is available in solution folder
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".
Thanks dude... btw, cyberweb.ga is not maintained anymore, the new website is www.sciber.ml
👊❤