Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to save users added controls?

How to save users added controls?

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yanhe
    wrote on last edited by
    #1

    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.

    K 1 Reply Last reply
    0
    • Y yanhe

      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.

      K Offline
      K Offline
      Kanniah
      wrote on last edited by
      #2

      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

      Y 1 Reply Last reply
      0
      • K 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

        Y Offline
        Y Offline
        yanhe
        wrote on last edited by
        #3

        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

        K 1 Reply Last reply
        0
        • Y yanhe

          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

          K Offline
          K Offline
          Kanniah
          wrote on last edited by
          #4

          Hi what you have written is correct. I don't think there is any other way to do this. Kanniah

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups