Can't get rid of Inherited form

  • Thread starter Thread starter Bob Ranck
  • Start date Start date
B

Bob Ranck

[VB WinForm]
Originally posted in General, but hope to have better
luck over here in Forms.

Lets say we build a BaseForm with several controls (as an
abstract form). Then we inherit this Base Form as
the "foundation" for a New WorkingForm.

Next we make an MDI Form and call the WorkingForm from
the MDI menu -"WorkingForm.Show". We immediately get an
unusual condition. Although the WorkingForm loads OK - -
- at the menu bar level of the MDI, we have two icons
showing two forms active (one for the WorkingForm and one
for the BaseForm)instead of just one as we would expect.

Next we Close the WorkingForm, but only one of the two
icons goes away, indicating that the BaseForm is still
loaded.

Next if we Open a WorkingForm again we now have three
icons, indicating that we have the WorkingForm and two
BaseForms. (If you continue to open and close forms
eventualy you crash with no more room)

Since my only call is -"WorkingForm.Show", My question is
how do you (what code would you use to) close the base
form or even better how do you keep from opening it and
make it act more like an abstract form
 
Hi Bob,

An obvious suggestion - the BaseForm should probably support MDI
(appropriate styles and properties configured - IsMdiChild, for example ?)
 
Neat idea, but it only raises the error

Additional information: A form can't be both an MDI child
and MDI parent.

Bob
-----Original Message-----
Hi Bob,

An obvious suggestion - the BaseForm should probably support MDI
(appropriate styles and properties configured - IsMdiChild, for example ?)

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Bob Ranck said:
[VB WinForm]
Originally posted in General, but hope to have better
luck over here in Forms.

Lets say we build a BaseForm with several controls (as an
abstract form). Then we inherit this Base Form as
the "foundation" for a New WorkingForm.

Next we make an MDI Form and call the WorkingForm from
the MDI menu -"WorkingForm.Show". We immediately get an
unusual condition. Although the WorkingForm loads OK - -
- at the menu bar level of the MDI, we have two icons
showing two forms active (one for the WorkingForm and one
for the BaseForm)instead of just one as we would expect.

Next we Close the WorkingForm, but only one of the two
icons goes away, indicating that the BaseForm is still
loaded.

Next if we Open a WorkingForm again we now have three
icons, indicating that we have the WorkingForm and two
BaseForms. (If you continue to open and close forms
eventualy you crash with no more room)

Since my only call is -"WorkingForm.Show", My question is
how do you (what code would you use to) close the base
form or even better how do you keep from opening it and
make it act more like an abstract form

.
 
I have probably misunderstood you. Could you please clarify whether the
WorkingForm serves as an MDI parent or as an MDI child in your application?

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Bob Ranck said:
Neat idea, but it only raises the error

Additional information: A form can't be both an MDI child
and MDI parent.

Bob
-----Original Message-----
Hi Bob,

An obvious suggestion - the BaseForm should probably support MDI
(appropriate styles and properties configured - IsMdiChild, for example ?)

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Bob Ranck said:
[VB WinForm]
Originally posted in General, but hope to have better
luck over here in Forms.

Lets say we build a BaseForm with several controls (as an
abstract form). Then we inherit this Base Form as
the "foundation" for a New WorkingForm.

Next we make an MDI Form and call the WorkingForm from
the MDI menu -"WorkingForm.Show". We immediately get an
unusual condition. Although the WorkingForm loads OK - -
- at the menu bar level of the MDI, we have two icons
showing two forms active (one for the WorkingForm and one
for the BaseForm)instead of just one as we would expect.

Next we Close the WorkingForm, but only one of the two
icons goes away, indicating that the BaseForm is still
loaded.

Next if we Open a WorkingForm again we now have three
icons, indicating that we have the WorkingForm and two
BaseForms. (If you continue to open and close forms
eventualy you crash with no more room)

Since my only call is -"WorkingForm.Show", My question is
how do you (what code would you use to) close the base
form or even better how do you keep from opening it and
make it act more like an abstract form

.
 
Dimtriy,
We have three forms,an MDI Form a BaseForm and a form
which inherits from the base form which I called the
WorkingForm. The MDI calls the working form - but the
crazy thing is that when it loads you can also see that
the base form not only inherits from the parent but you
get two icons in the menu bar on the MDI. (indicating
that the BaseForm which is the parent has also been
loaded in the MDI (even though you can not see it) It is
this invisible form that I cant get rid of. Also when you
load a second copy of the Base Form it again loads
another copy of it's parent.
Thanks for your help,
Bob
-----Original Message-----
I have probably misunderstood you. Could you please clarify whether the
WorkingForm serves as an MDI parent or as an MDI child in your application?

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Neat idea, but it only raises the error

Additional information: A form can't be both an MDI child
and MDI parent.

Bob
-----Original Message-----
Hi Bob,

An obvious suggestion - the BaseForm should probably support MDI
(appropriate styles and properties configured - IsMdiChild, for example ?)

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

[VB WinForm]
Originally posted in General, but hope to have better
luck over here in Forms.

Lets say we build a BaseForm with several controls
(as
an
abstract form). Then we inherit this Base Form as
the "foundation" for a New WorkingForm.

Next we make an MDI Form and call the WorkingForm from
the MDI menu -"WorkingForm.Show". We immediately
get
an
unusual condition. Although the WorkingForm loads
OK -
-
- at the menu bar level of the MDI, we have two icons
showing two forms active (one for the WorkingForm
and
one
for the BaseForm)instead of just one as we would expect.

Next we Close the WorkingForm, but only one of the two
icons goes away, indicating that the BaseForm is still
loaded.

Next if we Open a WorkingForm again we now have three
icons, indicating that we have the WorkingForm and two
BaseForms. (If you continue to open and close forms
eventualy you crash with no more room)

Since my only call is -"WorkingForm.Show", My
question
is
how do you (what code would you use to) close the base
form or even better how do you keep from opening it and
make it act more like an abstract form

.

.
 
Back
Top