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. Form Serialization

Form Serialization

Scheduled Pinned Locked Moved Visual Basic
helpquestioncsharpcom
2 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.
  • C Offline
    C Offline
    contact ajo
    wrote on last edited by
    #1

    hi i am working with project in vb.net, in this project i have to give a interface to end user in which he can change properties of each controls in runtime, for example, in a stock master form there is one label with text property 'Stock Code', for some customers it should be 'Product Id' and for some others it should be 'Part No.', so i put a button in every form called customize, so that user can click on this button and one child window will com, in this window i have placed a propertyGrid control, with this user can easily click and change properties of each control, thats fine. but how can i save this changed properties accociated with this form/user to disk and reload it next time? , i need a fast way to do this, because i dont want to slow down my form load because of this. somebody told me about binary form serialization, but base windows form class is not serializable, so i can't serialize a form. i think somebody can help me to solve this problem... waiting for replay.. thanks in advance ajo

    D 1 Reply Last reply
    0
    • C contact ajo

      hi i am working with project in vb.net, in this project i have to give a interface to end user in which he can change properties of each controls in runtime, for example, in a stock master form there is one label with text property 'Stock Code', for some customers it should be 'Product Id' and for some others it should be 'Part No.', so i put a button in every form called customize, so that user can click on this button and one child window will com, in this window i have placed a propertyGrid control, with this user can easily click and change properties of each control, thats fine. but how can i save this changed properties accociated with this form/user to disk and reload it next time? , i need a fast way to do this, because i dont want to slow down my form load because of this. somebody told me about binary form serialization, but base windows form class is not serializable, so i can't serialize a form. i think somebody can help me to solve this problem... waiting for replay.. thanks in advance ajo

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Since neither the Form nor the Form's Controls collection is Serializable, you'll have to implement some kind of collection yourself. Serializing the entire form is just overkill if all you're doing is changing the text of a few labels. First, what are the properties you're allowing the user to change? Are you also allowing the user to add/remove the number of controls? What types of controls? Are the properties you're allowing change to common between all of them? Once you have all these questions answered, you can create a class and collection manager to hold this information. This is where you can add your own serialization support. Google for "custom collections vb.net" for examples. Dave Kreskowiak Microsoft MVP - Visual Basic

      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