classes that inherit from Windows.Forms.Form - problem with View Designer 
Author Message
 classes that inherit from Windows.Forms.Form - problem with View Designer

suppose I would like to have my own Form class that performs some additional
operations and acts like a base class to other classes.

So I create it:

public class MyForm: Form
{
etc.

Quote:
}

then I would like to have an instance of it:

public class OneOfApplicationForms: MyForm
{

Quote:
}

everything goes OK but I am unable to change OneOfApplicationForms to View
Designer. here is the IDE message

---------------------------------------------
An error occurred while loading the document. Fix the error and then try
loading the document again. The error message follows:

The designer could not be shown for this file because none of the classes
within it can be designed. The designer inspected the following classes in
the file:

OneOfApplicationForms --- The base class 'myNameSpace.MyForm could not be
loaded. Ensure the assembly has been referenced or build if it is part of
the project.
-------------------------------------------------

I do not get it. Does it mean that I have to put the definition of MyForm to
the new project, make a DLL of it and reference it? It is kinda stupid
because the definition of MyForm is explicitely stated in the file MyForm.cs
that is a part of the project.
what is strange: the IDE knows that both MyForm.cs and
OneOfApplicationForms.cs contain form definitions. but MyForm can be viewed
in View Designer, its child (OneOfApplicationForms) can not.

MyForm: Forms.Form                      <--- can be viewed in View Designer
because it is ordinary form

OneOfApplicationForms: MyForm   <--- a child of MyForm can not be viewed in
View Designer but this is a form, too

I figured out that I can trick the IDE. I can change the definition of
OneOfApplicationForms to:

public class OneOfApplicationForms: Form      (NOT MyForm!)
{

Quote:
}

then design it in View Designer and then change the definition back to

public class OneOfApplicationForms: MyForm
{

Quote:
}

this works but it sounds really tough if I have about 100 various forms that
should be derived from MyForm.

So, my question is: does anyone have the idea what is wrong with View
Designer? Why it is unable to show a form class that inherits not from
System.Windows.Forms.Form but from its child? Is there a way to fix it?

Thanks for any ideas.

Wiktor Zychla



Sat, 20 Nov 2004 14:28:07 GMT  
 classes that inherit from Windows.Forms.Form - problem with View Designer
Hello Wiktor,

Have you rebuild your solution before you add the OneOfApplicationForms
class. If not, please try rebuilding the solution first. I have reproduced
the symptom. And fix it with a rebuilding. I hope it also can help you.

Best regards,

Lion Shi, MCSE, MCSD
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.  2001 Microsoft Corporation. All rights
reserved.
--------------------

    Subject: classes that inherit from Windows.Forms.Form - problem with
View Designer
    Date: Tue, 4 Jun 2002 08:28:07 +0200
    Lines: 73
    X-Priority: 3
    X-MSMail-Priority: Normal
    X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

    Newsgroups: microsoft.public.dotnet.languages.CSharp
    NNTP-Posting-Host: wroc.vulcan.pl 212.160.104.99
    Path: cpmsftngxa07!cpmsftngxa10!tkmsftngp01!tkmsftngp02
    Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:65556
    X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

    suppose I would like to have my own Form class that performs some
additional
    operations and acts like a base class to other classes.

    So I create it:

    public class MyForm: Form
    {
    etc.
    }

    then I would like to have an instance of it:

    public class OneOfApplicationForms: MyForm
    {
    }

    everything goes OK but I am unable to change OneOfApplicationForms to
View
    Designer. here is the IDE message

    ---------------------------------------------
    An error occurred while loading the document. Fix the error and then try
    loading the document again. The error message follows:

    The designer could not be shown for this file because none of the
classes
    within it can be designed. The designer inspected the following classes
in
    the file:

    OneOfApplicationForms --- The base class 'myNameSpace.MyForm could not
be
    loaded. Ensure the assembly has been referenced or build if it is part
of
    the project.
    -------------------------------------------------

    I do not get it. Does it mean that I have to put the definition of
MyForm to
    the new project, make a DLL of it and reference it? It is kinda stupid
    because the definition of MyForm is explicitely stated in the file
MyForm.cs
    that is a part of the project.
    what is strange: the IDE knows that both MyForm.cs and
    OneOfApplicationForms.cs contain form definitions. but MyForm can be
viewed
    in View Designer, its child (OneOfApplicationForms) can not.

    MyForm: Forms.Form                      <--- can be viewed in View
Designer
    because it is ordinary form

    OneOfApplicationForms: MyForm   <--- a child of MyForm can not be
viewed in
    View Designer but this is a form, too

    I figured out that I can trick the IDE. I can change the definition of
    OneOfApplicationForms to:

    public class OneOfApplicationForms: Form      (NOT MyForm!)
    {
    }

    then design it in View Designer and then change the definition back to

    public class OneOfApplicationForms: MyForm
    {
    }

    this works but it sounds really tough if I have about 100 various forms
that
    should be derived from MyForm.

    So, my question is: does anyone have the idea what is wrong with View
    Designer? Why it is unable to show a form class that inherits not from
    System.Windows.Forms.Form but from its child? Is there a way to fix it?

    Thanks for any ideas.

    Wiktor Zychla



Sun, 21 Nov 2004 21:36:07 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Windows Form Designer and private class members

2. MS Form 2.0 Form ActiveX Designer

3. VC++ .NET windows form designer can't be open for no reason

4. Windows Forms Designer for C++ in Everett

5. Windows Form Designer for .NET-C++ projects???

6. Windows Forms Designer not for Managed C++ ??

7. Creating a runtime Windows forms designer

8. Windows forms resizie in Designer

9. Serializing class that inherits Form

10. major speed decrease when class inherits from Winform.Form

11. Problem with Win32 Control in Forms Designer

12. form class accessing view class members?

 

 
Powered by phpBB® Forum Software