user564548
user564548

Reputation:

Designer error when inheriting forms

When I inherit a base form I get the following error when trying to open the designer:

"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: frmTest --- The base class 'TestInherit.BaseForm' could not be loaded. Ensure the assembly has been referenced and that all projects have been built."

In the designer code I use "Inherits BaseForm" (= Windows form) instead of the default "Inherits System.Windows.Forms.Form".

What am I doing wrong here?

NB: If you want you can download a test project here: https://dl.dropboxusercontent.com/u/5391091/TestInherit.rar

NB: I want/need all (base) forms in the same assembly.

NB: The same technique works without any problem when using Telerik forms. See this example project, using Telerik: https://dl.dropboxusercontent.com/u/5391091/TestInheritTelerik.rar

Upvotes: 1

Views: 2257

Answers (1)

Jens Kloster
Jens Kloster

Reputation: 11277

As I posted in comments, the solution is to move the base form to a different assembly.

enter image description here (pardon the other project is C#, i could not add a VB.NET proj)

Look at inhereted form now:

enter image description here

all I did was to add Import to frmTest.Designer.vb: enter image description here

The reason for this, is becuase the VS visualizer actually creates an running instance of the base form, when you are designen frmTest!

Upvotes: 0

Related Questions