Paste in one of your case statements and a screenshot of your control (if available), and someone should be able to run you through it. You might be able to shortcut some of your logic based on the characteristics of the controls.
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
Once you drag + drop a "control" on your "form" you can select the control and in the properties pane at the top there is an "events" button you will want to click.
Those events are most likely relevant to using your logic with your GUI. Find one, such as the "MouseClick" event, double click the white part of the drop-down to have the editor generate one for you.
pseudorandom21
Practically a Posting Shark
890 posts since Jan 2011
Reputation Points: 216
Solved Threads: 111
There's going to be some difficulty right off the bat when you are mixing the unmanaged C++ (the std::vector ) and the managed form (which uses an offbeat dialect of C++ called C++/CLI, so some of the data structures and syntax are different).
The GUI uses something called event-driven programming (which isn't unique to Winforms, most GUIs use it in some way), but essentially, you're not moving through your code linearly, you are doing something in response to someone clicking a checkbox, typing in a textbox, or clicking a button. So, rather than getline, you could, for example, have the user type something in the textbox, and once they select a radiobutton, your code will read the text into variable xyz.
Instead of using a vector (which is theoretically possible, but requires some juggling in most cases), you should use a cli::array (see http://www.functionx.com/cppcli/index.htm ) for some decent tutorials) or a .NET List object.
So, that's probably a lot to digest... A lot of the good tutorials for .NET are written for C#, but you can still reference them, as the classes and member methods are all the same, except for the -> and :: notation used in C++ with pointers and namespaces.
Post back as you run into any issues.
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
Yes. All of the controls have an .Enabled property that will allow them to be active or inactive (grayed out). You can also use the .Visible property to take them out of the form temporarily.
Having the logic carried out in a particular order could be done simply by checking to see if there is anything in the TextBox.Text property before allowing the user to change the radiobutton, or as sophisticated as setting a boolean variable during one of the Textbox events, and ultimately checking if it's true in the CheckChanged event of the radio button.
Start playing around with some of the simpler aspects of the UI (how do I gray out or hide one button by pushing another), or if you're beyond that point, take a crack at some of what you describe and post back with specific problems.
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581