inherited forms

  • Thread starter Thread starter Alexander Muylaert
  • Start date Start date
A

Alexander Muylaert

Hi

I seem to have a lot of problems with inherited forms in VS2003.

Problem 1:

Form1 has a txtEdit1. Form2 inheriteds from form1. But for some reason I
would like to be able to access form1.txtEdit. When I put his modifier to
protected instead of the default private. The control just disappears. IT
IS GONE. (as in not longer their or very much away).

Problem2:

Form1 has a panel docked to the bottom, and a central panel docked to fill.
Form2 needs a panel docked to top. For some sick reason this Form2.PanelTop
always overlaps the central panel. It doesn't move the central panel down,
making my first edit box INVISIBLE (as in not longer able to see it.)

Anybody can confirm these issues? Please tell me that I'm doing something
wrong here. Otherwise I have to assume that form inheritence doesn't work
in C# VS2003.

Kind regards

Alexander
 
HI,

First problem happens because designer thinks someone tampered with its
designer-generated code. The designer does not understand it no more
and removes the control. Controls are private to a form. You could use
a property to access the private control.

Second problem, is only a designer problem. You can add a third 'top'
panel by writing some code eg overriding OnLoad and adding the panel (to
the top). But no designing no more.

Hope this helps,
Benoit
 
Back
Top