Visual Inheritance

P

Phill. W

I've created my own form (say, "AppletBase" with some basic
controls (mainly GroupBoxes) on it. Now, I'm trying to inherit
from this to create [lots of] other applications.

[ancestor]
Class AppletBase
Inherits Forms.Form

[descendent]
Class Applet1
Inherits AppletBase

So why, then, does the VS (2003) IDE *not* offer me a "View
Designer" option so that I can put more specific controls onto the
descendent form???

Sure, I can "View Code" it, but it's not half as pretty ... :)

TIA,
Phill W.
 
A

Armin Zingler

Phill. W said:
I've created my own form (say, "AppletBase" with some basic
controls (mainly GroupBoxes) on it. Now, I'm trying to inherit
from this to create [lots of] other applications.

[ancestor]
Class AppletBase
Inherits Forms.Form

[descendent]
Class Applet1
Inherits AppletBase

So why, then, does the VS (2003) IDE *not* offer me a "View
Designer" option so that I can put more specific controls onto the
descendent form???

Sure, I can "View Code" it, but it's not half as pretty ... :)

Is the 2nd Form the first class in the *.vb file? Is there other code above?
If yes, which?

If it's only an IDE problem: sometimes it's sufficent to close the solution
and open it again, and the designer will be available again.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
P

Phill. W

Repeatedly . . .

Eric Sabine said:
have you rebuilt the solution?

Phill. W said:
I've created my own form (say, "AppletBase" with some basic
controls (mainly GroupBoxes) on it. Now, I'm trying to inherit
from this to create [lots of] other applications.

[ancestor]
Class AppletBase
Inherits Forms.Form

[descendent]
Class Applet1
Inherits AppletBase

So why, then, does the VS (2003) IDE *not* offer me a "View
Designer" option so that I can put more specific controls onto the
descendent form???

Sure, I can "View Code" it, but it's not half as pretty ... :)

TIA,
Phill W.
 
P

Phill. W

Armin Zingler said:
.. . .
Is the 2nd Form the first class in the *.vb file?
Yes.

Is there other code above? If yes, which?

Just these two lines :

Imports root.AppletUI
Namespace Some.OtherNamespace
If it's only an IDE problem: sometimes it's sufficent to close the solution
and open it again, and the designer will be available again.

BINGO!!
Just as you say; close and reopen the solution and my designer's
back again.

Should I expect this sort of thing to happen often? :-/

Regards,
Phill W.
 
A

Armin Zingler

Phill. W said:
BINGO!!
Just as you say; close and reopen the solution and my designer's
back again.

Should I expect this sort of thing to happen often? :-/

Yes, it happens now and then.
 
A

Andrew Bingham

I have inherited forms in the application I am currently working on - and
they have both a Visual Designer and a "code" class. Indeded visual
inheritance woudl be pointless without this !

One suggestion - the class "behind the form" does not have to be the same
name as the form - ensure you are inheriting from the Form.

For example :
* crate and open a new form, say Form1.vb in Solution Explorer
* you will see the form and the "code behind" both open in VS IDE
* the "code behind" will be called Class Form1.
* rename the class to, say, "Apricot" (do a search and replace though as
the name is used elsewhere in the code)
* the form will compile and you can run it

cheers

Andrew

PS IF hits is the case - it may have happened if you renamed the form,
depending how you did the rename

--
****************************************************************************
andrewbingham.com

tel 01223 514674 (Cambridge)
mobile 07970 161057
fax 07970 601283
email (e-mail address removed)

DISCLAIMER, PLEASE NOTE:
This communication is for the attention of the named recipient only
The content should not be passed on to any other person.
It is sent in good faith, in confidence, and without legal responsibility.

VIRUS CHECK
Emails and attachments are virus checked using Norton® AntiVirus®
2002 which is regularly updated. However it remains the recipients
responsibility to check emails and attachments sent, or forwarded,
from andrewbingham.com for viruses and macro viruses
****************************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top