Re: Form inheritence



Hi,

Now I have a problem in creating an inherited form.
I created a Class Library and a base form in it, then want to add a new form
inherited from that base form.
VS 2005 ask me about the base form but only limited to a dll. If I choose to
inherit from the base form then it cannot let me thro the process, only
select a dll.

"Bruce Wood" <brucewood@xxxxxxxxxx> wrote in message
news:1162926497.531741.43020@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You can edit the definitions that Visual Studio Designer inserts into
your .cs file. Or, if you're using .NET 2.0, you'll have to find the
other half of your Form's partial class, the half written by Visual
Studio. If you close the Designer, change things from private to
protected in code and then restart the Designer, all should be well.

Within the Designer itself... well, it's select, change, select,
change, ....

Alan T wrote:
Thanks Bruce.
I just what would happen if I have up to hundred controls in my ancestor
form and need to change it to Proteced manually.
Is that any shortcut to change the controls from private to proteced ?

"Bruce Wood" <brucewood@xxxxxxxxxx> wrote in message
news:1162885552.625704.199700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Alan T wrote:
Hi,

Yes now I can create a inherited form.
However, it seems does not allow me to move the controls in my
inherited
form.
I got a groupbox and would like to add another text box inside this
groupbox
but it does allow me to.

You need to change the Protection setting of the controls on the base
form from Private (the default) to at least Protected so that they are
changeable by inheriting forms.




.



Relevant Pages

  • RE: Form Load - Designer Exception
    ... 2.> forms are inherit from base templates... ... In fact, if a form is inherited from a base form, when we open it in the ... InitializeComponent method of the currently opened form is executed. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)
  • Re: Creating Forms with fixed set of controls
    ... The same way they'll inherit the Form ... If the button itself exists as an instance on the base form, ... I am not aware of a general-purpose way that you can do something simple and have all of your controls draw in a different color, ... As of Windows XP, there's an idea called "visual styles", but AFAIK this is controlled by the OS; you can take advantage of it to use the "current style" for your UI, but your application cannot override the current visual style by automatically using a different visual style for rendering. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: inherited forms - random debugging errors
    ... inherit from a base form. ... > projects of sufficient complexity. ... >> I have an application that has many inherited forms from a base form. ... I need to Rebuild the Solution ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Exposing a field in a base control to inherited control via de
    ... I have a panel in a base form that I want to somehow ... that declared it and any classes that inherit that class. ... lets call it contentPanel. ... using the visual designer. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Creating similar versions of apps with inheritance
    ... I'd suggest to take a look on books about design patterns. ... I may in the future> convert the main form to an abastract form (must inherit). ... > I would then like to have a separate project for each version where the> main ... > form is then inherited from the base form mentioned above. ...
    (microsoft.public.dotnet.framework.windowsforms)