TWWebBrowser is my subclassed WebBrowser in a spirit of Foxpro guidelines.
I've just tried to add a label, and a property for label to my usercontrol
public Label LLabel
{
get { return label1; }
set { label1 = value; }
}
but it didn't make any difference , I can't see LLabel in drop down menu of properties on a form where I put a parent usercontrol with that label.
Folks at
http://www.vfpconversion.com/Article.aspx?quickid=050084seem to confirm my statement for public children ( they don't mention children wrapped as properties though ). Article related to VS2003 , I am in VS 2008 from Friday , but the same behaviour.
It would be interesting to see the simple example how it works at solution level if you could expose it somehow , as usercontrol is very important building block , and it would be very handy to see elements of that in properties.
>Strange. The Property *should* show up in your Property Sheet. I have plenty of controls sub-classed from UserControl, so I know it works. The only thing I can think of is that it might have something to do with the type of property being something called TWWebBrowser (I don't know what that is). Maybe a reference needs to be added? I don't know ... just guessing.
>
>~~Bonnie
>
>
>
>>Perhaps, I misunderstood your point. Assuming I've got user control with a split container and 2 browser controls in the panels.
>>I created a property , though member fullViewBrowser is internal anyway.
>>
>> public partial class HtmlHitlist : UserControl
>> {
>>
>> public TWWebBrowser FullViewBrowser
>> {
>> get { return fullViewBrowser; }
>> set { fullViewBrowser = value; }
>> }
>>
>>I put control on a form tab page as htmlHitList1
>>Am I supposed to see FullViewBrowser in Properties for that form ? Probably not, as I don't. For some reason in VS they decided to treat usercontrol as a black box in designer view. Surely either member or property are accessible in a code.
>>
>>
>> protected override void OnShown(EventArgs e)
>> {
>>
>> base.OnShown(e);
>> this.htmlHitlist1.FullViewBrowser.DocumentText = "<html><hr><h2>Full view</h2><hr></html>";
>> this.htmlHitlist1.fullViewBrowser.DocumentText = "<html><hr><h2>Full view</h2><hr></html>";
>>
>> ...
>>
>>
>>
>>>>Just curious , does similar limitation apply to usercontrol used as a container. Unlike Visual Foxpro when placed on a form, children are not editable via property sheet regardless of access modifier. No problem to deal with them programmatically.
>>>
>>>No, there is no such limitation with UserControls ... but to be able to edit them via the Property Sheet, you would need real properties (with get/set), rather than simply protected or public modifiers.
>>>
>>>~~Bonnie
>>>