PDA

Click to See Complete Forum and Search --> : [RESOLVED] TabControl Question


ekim12987
Dec 23rd, 2006, 08:04 PM
I am writing a program with a tab control, giving the user an option to add a new tab. When the user adds a new tab it works fine, when the application closes then reopens the tab that they created is gone. Is there a way to permenantly add tab to the tabcontrol? To create the tab I am using tbcMain.TabPages.Add(newPage);

jmcilhinney
Dec 23rd, 2006, 08:38 PM
When your application runs it executes the code contained in the executable file. If that code doesn't tell it to add the new tab then it's not going to. If you want to be able to persist changes between sessions then you need to save that information somewhere so that your application can read it the next time it's run. That means that you need to write code so that your application will read the number of tabs from this location EVERY time it runs.

Where you save this information is up to you and the best way will depend on exactly what information needs saving. Much information gets saved to databases. If all you need to do is save the number of tabs then application settings is probably the way to go. If you need to save more complex configuration information then you may want to save and load data in your own XML file rather than the standard application config file.

You should read about application settings in the MSDN library at least to see what they can do for you. If you decide that they're not suitable then you can look further afield.

ekim12987
Dec 23rd, 2006, 08:49 PM
Thanks for the quick reply, application settings I think will work for me