Originally Posted by Daggerfist
I'm trying to create an application just for myself to use at home. I have the ui down but can't figure out some of the functionality.
Basically I want the program to start with several textboxes lined up, and when I click a button it should create another set of textboxes under the first set, and move the button down to line up with the second set of boxes.
Another thing I can't figure out is how make textboxes work while using a tab control container. I want the textboxes to appear on any tabs the user creates, but the textboxes remain empty until the user inputs any data.
If someone could point me in the right direction I'd be grateful.
You definitely have some weird requirements.
I am going to directly state that I am in Visual C# mode right now, but a lot of the VStudio 2010 is identical.
First:) The Tab Pages are unique individual objects. There are ways to force them to appear, but is much easier to just copy and paste your textboxes as new textboxes (don't forget to rename them.) You can batch copy like you would with files (CtrL + Click for multiple) it retains the spacing and alignment.
If you are getting confused with the naming convention, I abandon Hungarian / Pascal and just do something like this.
When you click a button, you are executing an Event, so you will need an event handler for this button click. To quickly create one, just double click the button in the Design View, it should take you to the Code View with a method stub already carved out.
To insert an object onto the canvas you will have to put in the object via code, and give it a position, this is akin to creating an object and then drawing it (Java is notorious for this stuff.) There is no moving per-se, and the previous method is arduous and complicated You CAN however create the illusion of movement. In order to do this, you must put an extra button and extra four textboxes on the Design View.
You then set their default property to Hidden, you can do this in your main method by executing tbxInput.Hide(); or perhaps in properties You then have the option to use the .Show(); method IF that button is clicked, it will then make the boxes and button appear where you placed them in design view. Now, you also have to remember to hide the original textboxes and the original button in the same event handler!
I think that might help you get some progress. Good luck!
Edited by RagingCain - 5/9/12 at 6:56pm