Add a tabpage to a tabcontrol
I have a somewhat complicated (at least for me) question about tabpages on tabcontrols.
Program Scenario:
I have a form that asks the user a few questions, and based on their answers I want tabpages created. For instance, "What type of movies do you like?". The options the user can select from are "Horror", "Action", "Comedy", "Drama", "Sci-Fi". If the user, through checkbox's, selects any of these options, I would like to create tabpages for however many options they selected. I want these tabpages to contain textbox's, labels, combo box's, groupbox etc. etc. alreay set up for movie names, times they've seen it and so on. I know all the positions and locations that these controls are suppose to be on each tabpage. I would like to have each control on each tabpage created, named properly so I can save the information to a dataTable and the info is there everytime they open the program. I would like to also have the option of the user adding a tabpage later on if they wanted too.
So my main question is, if the user selects "Horror" and "Sci-Fi", how can I create only 2 tabpages, give them the correct names (Horror and Sci-Fi), add the controls where I need them with each control having the correct names for each tabpage created (i.e. txtMovieName_Horror and txtMovieName_SciFi?
|