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. Custom properties

Custom properties

Scheduled Pinned Locked Moved Visual Basic
questiondesignhelp
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.
  • U Offline
    U Offline
    udikantz
    wrote on last edited by
    #1

    hey i have created my own custom property the property is of type collection , it displays a form which allow the user to add a list of images and strings, it stores the data in a collection , my problem is , i have noticed that after adding items to the collection at design time , there is no code generated in the .Designer file of the form and there for when i close the for / save it and reload it , all the items that i added to my custom property are gone. my question , what did i miss here ? how do i make my custom property generate code at the .designer file for the items i have added to my property? thanks.

    Net

    D 1 Reply Last reply
    0
    • U udikantz

      hey i have created my own custom property the property is of type collection , it displays a form which allow the user to add a list of images and strings, it stores the data in a collection , my problem is , i have noticed that after adding items to the collection at design time , there is no code generated in the .Designer file of the form and there for when i close the for / save it and reload it , all the items that i added to my custom property are gone. my question , what did i miss here ? how do i make my custom property generate code at the .designer file for the items i have added to my property? thanks.

      Net

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

      You have to tag the public properties you want the designer to write code for with the DesignerSerializationVisibility attribute. Like this:

      DesignerSerializationVisibility(DesignerSerializationVisibility.Visible) \_
      Public Property MyControlProperty() as Integer
          ....
      End Property
      

      You can find the docs on the DesignerSerializationVisibility Attribute class here[^].

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      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