Properties not exposed at design time
I'm loading up at usercontrol on my webform like so:
VB Code:
Dim aSkin as Control = nothing
aSkin = LoadControl(("/Themes/default/Skins/default.ascx"))
I have defined a public property in this usercontrol, default.ascx, called bgColor.
My problem is that once i've loaded this control, the properties of aSkin are just the default properties of a control. The public property that i've defined is not exposed during design time, it is only exposed at run time.
I want to access the value of this bgColor property at design time. How would I do this?
Any takers?
Patch
Re: Properties not exposed at design time
I don't have any references open right now, but I think you need to set the Browsable attribute for that property to true. Something like
<Browsable() = True>Public Property bgColor() As String
Re: Properties not exposed at design time
Re: Properties not exposed at design time
Thanks
Tried that now, but doesnt seem to work.
I don't know how the designer would be able to recognise which control i'm loading exactly with the loadcontrol() method. It could be any control in my solution, so it simply puts the default properties of a control in the property browser. The difference between this situation and the one in the other post, is that he is referencing a specific control, whereas mine can be any control.
Re: Properties not exposed at design time
You could alwawys just do:
aSkin = Ctype(LoadControl(("/Themes/default/Skins/default.ascx")), YourControlType)
Then you should be able to do .bgcolor at the end.