Re: Exposing a field in a base control to inherited control via de
- From: Rich Denis <cojones@xxxxxxxxxxxxxxxx>
- Date: Thu, 6 Jul 2006 12:49:01 -0700
Thanks for your response. As I stated in my initial query that is exactly
what I am trying to do. I have a panel in a base form that I want to somehow
encapsulate in the child form AND have it be designable in the inheriting
form.
--
Rich
"Kevin Spencer" wrote:
If it is protected, it is not available to any classes other than the class.
that declared it and any classes that inherit that class.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist
Big thicks are made up of lots of little thins.
"Rich Denis" <cojones@xxxxxxxxxxxxxxxx> wrote in message
news:7283062B-A22C-43D4-A29F-862E49E3567F@xxxxxxxxxxxxxxxx
Hello,
I apologize if this issue has been brought up before but I could not find
reference to it. Any help would be appreciated.
Here's the basic situation. We have a base form that controls the general
layout of things for all the various forms in the Order hosted app. The
form
has a panel on it; lets call it contentPanel. We have forms that inherit
from this base form and need to be able to place controls in contentPanel
using the visual designer.
Currently, we have something like:
class BaseForm
{
protected Panel contentPanel;
}
class InheritedForm : BaseForm
{
private Control someControl;
void InitializeComponent()
{
// the designer inserts code similar to
contentPanel.Controls.Add(someControl);
}
}
What you see above works, but exposing the field contentPanel bothers me.
I
don't really like exposing fields, especially collections and containers,
to
outside classes. Unfortunately, I don't know of any way to encapsulate
the
field and still have things work properly in the designer. Does anyone
have
thoughts on how to arrange things such that I can make contentPanel a
private
field and still be able to use the designer in the inherited form?
--
Rich
- Follow-Ups:
- Re: Exposing a field in a base control to inherited control via de
- From: Linda Liu [MSFT]
- Re: Exposing a field in a base control to inherited control via de
- References:
- Re: Exposing a field in a base control to inherited control via design
- From: Kevin Spencer
- Re: Exposing a field in a base control to inherited control via design
- Prev by Date: Re: Exposing a field in a base control to inherited control via design
- Next by Date: Re: Exposing a field in a base control to inherited control via de
- Previous by thread: Re: Exposing a field in a base control to inherited control via design
- Next by thread: Re: Exposing a field in a base control to inherited control via de
- Index(es):
Relevant Pages
|
Loading