MSVS 7.1 C++ .NET windows form app challenge I make a lot of use of VB
for quick little apps with textbox i/o and buttons to run my
calculations. I do this b/c it is EASY in spite of all the
condemnations I hear of VB being
inferior to VC++. I would like to start using VC++ for the same things
to get more comfortable with it in anticipation of larger projects
where it might actually be justified.
Every college textbook I see about C++ doesn't even attempt to use the
GUI. It is always "cout, cin" and an ugly black console display. I
want a GUI form with buttons. Nobody is going to pay me for "DOS"
programs, even if they do
pick the right stock trades. Unfortunate and stupid, but very true.
Here is the challenge: SHOW ME HOW TO:
Making the appwizard choices that get me started in a VB-like setting
e.g. a form and a toolbox, I still find I cannot do the most
elementary things like getting data in to and out of the pgm with a
textbox. For all of the power and glory of C++, it "cannot convert"
from one elementary data type to another. Strings, which never were
part of C, are still an "afterthought" requiring special class
libraries to do the most mundane stuff. After a fair amount of
fruitless web searching, I found some expert opinion claiming that
VC++ "did not support drag/drop gui design" such I am attempting to
do. I find this very
difficult to believe.
SHOW ME HOW TO GET VALUES IN AND OUT THRU A TEXTBOX THAT ALLOW SIMPLE
FINANCIAL CALCULATIONS TO BE DONE WHEN THE BUTTON IS PRESSED.
This is my code. I cannot copy the textbox contents to an integer, or
vise versa. I can, however, type text in that I can add to the
listbox. There seems to be a big distinction between "managed" strings
and regular ones that may further complicate using traditional
"strcat" type functions. Is there
a simple, native-mode fix e.g. not requiring some bloated, 3rd-party,
private: System::Void button2_Click(System::Object * sender, System::EventArgs * e)
//s2 string = S"s2";
System::String __gc * s3 = "s3";
//System::Int32 __gc * a3=0;
//String * s2 = "s2";
//itoa(a2, s2, 10);
//created as MSVS 7.1 C++ .NET windows form app