G
Guest
Interesting behavior I came across today where a child form has full access
to a base form class' controls, but you can only modify the controls'
properties in code, not in the visual designer. Here's how you can reproduce
it:
New Winforms project
On Form1, drop a visual control. I'll use a panel in this example.
Make sure Panel1 modifier is set to "Friend"
Build project
Add another form - this one an inherited form. Set it to inherit from Form1.
At this point, you can go to the Form2 code editor and you will indeed have
full access to Me.Panel1 and all its properties.
However, if you go to the visual designer of Form2 and click on Panel1,
you'll notice in the F4 properties window, all of the properties are greyed
out as if Panel1 was declared "Private".
After some searching here, I noticed that this was identified as a bug in
VB.NET 2003, however, the same behavior happens in 2005 as well. Is this
still considered a bug? Or has it been upgraded to "feature"?
to a base form class' controls, but you can only modify the controls'
properties in code, not in the visual designer. Here's how you can reproduce
it:
New Winforms project
On Form1, drop a visual control. I'll use a panel in this example.
Make sure Panel1 modifier is set to "Friend"
Build project
Add another form - this one an inherited form. Set it to inherit from Form1.
At this point, you can go to the Form2 code editor and you will indeed have
full access to Me.Panel1 and all its properties.
However, if you go to the visual designer of Form2 and click on Panel1,
you'll notice in the F4 properties window, all of the properties are greyed
out as if Panel1 was declared "Private".
After some searching here, I noticed that this was identified as a bug in
VB.NET 2003, however, the same behavior happens in 2005 as well. Is this
still considered a bug? Or has it been upgraded to "feature"?