Aug 25, 2013 at 1:11pm
Hi! I'm creating a calculator with a GUI, and I'm having some troubles.
I've created a button what says: "Calculate" and a Text Box what says "Value".
My questions are:
How I create a label like VB.Net? Just a text in my GUI, can someone explain for me? 8)
And...
How I get the text which the user has typed in the TextBox? Like the scanf in a TextBox...
Thanks!
Aug 25, 2013 at 1:27pm
This depends on what you are using to make your GUI. Is it the WinAPI? Is it MFC? Is it Qt?
I'll do a quick mockup in Qt to show you.
Aug 25, 2013 at 1:34pm
I'm using Code:Blocks to make the Calculator...
The button code(if helps):
CreateWindow(TEXT("button"), TEXT("Calculate"),
WS_VISIBLE | WS_CHILD,
70, 200, 412, 25, /*X Pos, Y Pos, Widht, Height*/
hwnd, (HMENU) 1, NULL, NULL
);
Aug 25, 2013 at 5:48pm
Last edited on Aug 25, 2013 at 5:58pm
Aug 28, 2013 at 1:53am
Ty andywestken, it was almost what I was searching for...
But, how I can "say" to the computer which textbox he is going to get the value? ;)
Maybe you can give an exemple using a textbox with ID "x" which just accept numbers(as I said, I'm doing a calculator)
Thx;
Last edited on Aug 28, 2013 at 2:03am
Aug 29, 2013 at 2:36am
Can you make a example? =/ I'm new with C++ programming :|
Yes, "Text Box" it's "Edit", in VB.Net it's text box ;P