Visual C++ and stuff

A forum for computer hardware and software issues
Post Reply
MrBlah
Villun
Villun
User avatar
Posts: 6469
Joined: Sat Dec 30, 2006 2:20 am
Location: Colorado. There's like, mountains and stuff.

Games Played

Ville Awards

Mxtress Blah’s avatar
Loading…

Visual C++ and stuff

Post by MrBlah » Mon May 02, 2011 9:34 pm

So... I have a working knowledge of C++, but not so much of Visual C++. Therefore, what does one do when you wish to create a GUI instead of a command line input? I have no idea really, that's why I came here.

Problem I am having:

I have created a textbox and given it a name via the properties thingy on the left side that I conveniently remembered about when I learned about Visual Basic and VB.net 6 years ago.

This is the code created in Form1.h, the name I gave the textbox was "LandGoal" and I wish to manipulate the input

Code: Select all

// 
// LandGoal
// 
this->LandGoal->Location = System::Drawing::Point(143, 28);
this->LandGoal->Name = L"LandGoal";
this->LandGoal->Size = System::Drawing::Size(100, 20);
this->LandGoal->TabIndex = 0;

So, how do I take the input of that textbox and then do mathematical magic to it so I can get a decimal output?
Image
Eater of Potatoes, since 2008.


I am driven by two main philosophies: know more today about the world than I knew yesterday and lessen the suffering of others. You'd be surprised how far that gets you.
― Neil deGrasse Tyson

The Spanish Inquisition
Villun
Villun
User avatar
Posts: 697
Joined: Wed Feb 11, 2009 10:32 pm

Ville Awards

Re: Visual C++ and stuff

Post by The Spanish Inquisition » Mon May 02, 2011 9:51 pm

What about the 'and stuff?" You said in the title of this thread, Visual c++ AND STUFF.
Nobody Expects the Spanish Inquisition!

frostdillicus
Retired Admin
Retired Admin
User avatar
Posts: 1100
Joined: Fri Dec 14, 2007 1:04 pm

Games Played

Ville Awards

frostdillicus’s avatar
Loading…

Re: Visual C++ and stuff

Post by frostdillicus » Mon May 02, 2011 9:52 pm

My first question is, do you HAVE to use Visual C++?
Image

MrBlah
Villun
Villun
User avatar
Posts: 6469
Joined: Sat Dec 30, 2006 2:20 am
Location: Colorado. There's like, mountains and stuff.

Games Played

Ville Awards

Mxtress Blah’s avatar
Loading…

Re: Visual C++ and stuff

Post by MrBlah » Mon May 02, 2011 10:18 pm

Well, no... it all works on a command line input, I just want to learn how to make it work using Visual C++? Or some other method that creates a GUI? I can use DevC++ too.
Image
Eater of Potatoes, since 2008.


I am driven by two main philosophies: know more today about the world than I knew yesterday and lessen the suffering of others. You'd be surprised how far that gets you.
― Neil deGrasse Tyson

frostdillicus
Retired Admin
Retired Admin
User avatar
Posts: 1100
Joined: Fri Dec 14, 2007 1:04 pm

Games Played

Ville Awards

frostdillicus’s avatar
Loading…

Re: Visual C++ and stuff

Post by frostdillicus » Mon May 02, 2011 11:03 pm

My question mostly revolves around the fact that user interfaces in windows using C++ are a pain in the butt. I jumped ship on doing any GUI programming in C++ when .Net and C# rolled around.

I keep my C++ skills sharp, I just don't do it with anything that requires a GUI. :P
Image

gator
Retired Admin
Retired Admin
User avatar
Posts: 2225
Joined: Sun Oct 29, 2006 8:34 am

Games Played

Ville Awards

gator’s avatar
Loading…

Re: Visual C++ and stuff

Post by gator » Mon May 02, 2011 11:10 pm

I don't do development in VS, but glancing at the docs... assuming you're using this:
http://msdn.microsoft.com/en-us/library ... .aspx#Y114

Use the Text property to get the content of the textbox as a String, then use methods in the Convert class to convert that String value to whatever numeric type you need.

http://msdn.microsoft.com/en-us/library ... nvert.aspx

MrBlah
Villun
Villun
User avatar
Posts: 6469
Joined: Sat Dec 30, 2006 2:20 am
Location: Colorado. There's like, mountains and stuff.

Games Played

Ville Awards

Mxtress Blah’s avatar
Loading…

Re: Visual C++ and stuff

Post by MrBlah » Mon May 02, 2011 11:13 pm

I suppose I could do it in C# or .net, seeing as those were the first two languages I learned and stuff.

I'll have a look at it that way and see where I get.
Image
Eater of Potatoes, since 2008.


I am driven by two main philosophies: know more today about the world than I knew yesterday and lessen the suffering of others. You'd be surprised how far that gets you.
― Neil deGrasse Tyson

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests