|
-
Jul 30th, 2005, 04:28 PM
#1
Thread Starter
Addicted Member
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
-
Jul 31st, 2005, 04:28 AM
#2
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
-
Jul 31st, 2005, 04:29 AM
#3
Re: Properties not exposed at design time
-
Jul 31st, 2005, 06:33 AM
#4
Thread Starter
Addicted Member
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.
-
Aug 3rd, 2005, 03:42 PM
#5
Fanatic Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|