Waterside
asked on
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 ?
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 ?
ASKER
Yes I take your point, but the question was aimed more at displaying/enabling additional properties in the designer.
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).tbcol or
.. 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()
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).tbcol
.. 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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
tnx
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