Changing available Properties at Design time

I have a custom control that makes use of four different images.  These images are stored as Assets under the various 'themes', such that the 'Star Theme' which will have four images based on star shapes.

The control has a Theme property, but I would like to extend the concept so that user defined Themes can be created.

I hope to add 'UserDefined' to my Themes enumeration and if this option is selected from the property page then I would like to display four new properties from where the four user defined image sources can be set.

I noticed a RefreshProperties attribute.  Do I use this ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ess KayEntrapenuerCommented:
i wouldn't use enumeration for custom themes.  

i would have a database table for user defined themes,

the enumeration can stay,  for the hardcoded themes,  but add one more enumeration for userdefined,  in which case it would query the database for the image locations,  colors..  etc

hope that helps
WatersideAuthor Commented:
Yes I take your point, but the question was aimed more at displaying/enabling additional properties in the designer.
Ess KayEntrapenuerCommented:
what i do is i have a custom made session class

inside it i have all the variables,  displays,  and other user preferences

lets say for example you have a textbox and you want to control the font color

public class sessions
  private tbColor as System.color

  Sub LoadSession
     ... connect to database here...
    .. or a local file...
    tbColor = (localfile/database).tbcolor
    .. load the other session variables..
 .. personally,  i store in the app/settings/roaming folder...
  End Sub

  function getTbColor as System.Color
     Return tbColor
  end function

end class

Then in your main form,  call LoadSession when your program starts.

Finally in your OnLoad of the form/udc that you want to edit,  you would do a loop through all controls where type is textbox
And set control.forecolor = getTbColor()

alternatively you can call the object directly  me.mycooltextbox.forecolor = getTbColor()
Ess KayEntrapenuerCommented:
as far as the control you have,  you hav to directly call the parts you want to re-design,  

ie,  me.mycoolcontrol.backgroundimage = sessions.getMyBackgroundImage1location()

me.mycoolcontrol.controlwithanotherimage.backgroundimage = sessions.getMyBackgroundImage2Location


ps.  sorry for the lack of formatting, grammar and spelling,  am writing this on my phone

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WatersideAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.