all groups > dotnet windows forms designtime > september 2005 >
You're in the

dotnet windows forms designtime

group:

Inherited Controls


Inherited Controls Christopher Weaver
9/5/2005 12:43:30 PM
dotnet windows forms designtime: When inheriting from a superclass, there is one situation wherein I would
like to hide some of the inheritted controls at design time. Can I do this?

Re: Inherited Controls Christopher Weaver
9/5/2005 1:40:09 PM
OK, fair question. I've created a SuperClass which includes, in addition to
a bunch of code, three visual control elements. Now I'm creating a test
form to test some of the code and some additional code and the controls are
really in the way of the test buttons and textboxes, etc., that I'm putting
on this test form. I just don't want to see them at design time. At run
time, they are hidden by some start up code.




[quoted text, click to view]

Re: Inherited Controls Christopher Weaver
9/5/2005 4:18:04 PM
Right. Within the Load method of the form, I've set the Visible property to
false on each of the controls that I don't want to see at run time, and that
works. It's just that they're anoying during design and I was wondering if
I could make them non-visible there as well. Seems unlikely, but I thought
I would ask anyway.


[quoted text, click to view]

Re: Inherited Controls Tim Wilson
9/5/2005 4:19:25 PM
Are you asking about hiding inherited properties or did you really mean
hiding inherited controls within some type of composite control (like a
UserControl)?

--
Tim Wilson
..Net Compact Framework MVP

[quoted text, click to view]

Re: Inherited Controls Tim Wilson
9/5/2005 5:37:18 PM
So the controls are supposed to be hidden at runtime too? If so then just
set the "Visible" property of each control to false from within the
constructor (sub New in VB). Or is there more to this?

--
Tim Wilson
..Net Compact Framework MVP

[quoted text, click to view]

Re: Inherited Controls Tim Wilson
9/5/2005 8:07:09 PM
So it sounds like you're doing visual inheritance with forms. Is that
correct? If that's the case then, as far as I know, you cannot hide the
controls that are inherited from the base form at design-time. I thought
that you may have been refering to a custom control, like a custom
UserControl, that contains other controls.

--
Tim Wilson
..Net Compact Framework MVP

[quoted text, click to view]

AddThis Social Bookmark Button