How to save users added controls?
-
Here's my question I know how to create controls and add them to the winform at runtime. While I hope I can save added controls somewhere on the disk, so next time the users open the winform, the added controls will be there. Thanks.
Hi You have to store the information somewhere in the database/textfile from where you can load the controls when the user wants at a later stage. The information to be stored are Control Type, Left, Top, Width and Height, so that you can recreate the controls and set these properties. Hope this helps you. Kanniah
-
Hi You have to store the information somewhere in the database/textfile from where you can load the controls when the user wants at a later stage. The information to be stored are Control Type, Left, Top, Width and Height, so that you can recreate the controls and set these properties. Hope this helps you. Kanniah
Thank you so much, this does help me. but I got a further question about this. I am doing a project pretty much like the photoshop (but much simpler and easier). Users can add and edit controls on a winform. I was trying to save the users added controls in a txt file by saving a string object.gettype.tostring. e.g: "System.Windows.Forms.PictureBox" while when trying to Retrive the information, How can I create this object back? I can do the following: if string = "System.Windows.Forms.PictureBox" then dim a as new picturebox end if Are there other ways of doing this? Thanks
-
Thank you so much, this does help me. but I got a further question about this. I am doing a project pretty much like the photoshop (but much simpler and easier). Users can add and edit controls on a winform. I was trying to save the users added controls in a txt file by saving a string object.gettype.tostring. e.g: "System.Windows.Forms.PictureBox" while when trying to Retrive the information, How can I create this object back? I can do the following: if string = "System.Windows.Forms.PictureBox" then dim a as new picturebox end if Are there other ways of doing this? Thanks