user1417294
user1417294

Reputation: 314

Windows Forms Saving controls Layout Information using XML

I have designed a form to create controls like textbox, panels buttons dynamically. I have an option to edit the size and position of the controls. I need to maintain the layout and the parent and child relation of the controls so that I can save the information and re-create it when loaded again. Is there any other better option other than XML to maintain the layout information?

Thanks in Advance.

Upvotes: 1

Views: 1366

Answers (2)

Veldmuis
Veldmuis

Reputation: 4868

Do you have the option of saving it in the database (per user if required)? If you have to implement it file-based XML is probably the easiest option, whether you go the app.config route or write your own class to save and retrieve custom user settings from XML - a good place to save this might be the user's AppData folder.

Anything saved to app.config might be lost when you use something like ClickOnce to do version upgrades.

Upvotes: 0

yogi
yogi

Reputation: 19619

Try using app.config file it'll provide you better operations and will save a lot of code that you'll be doing right now to iterate through your saved XML file. For more info Go here

Upvotes: 1

Related Questions