By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,682 Members | 1,090 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,682 IT Pros & Developers. It's quick & easy.

Viewing forms in design view error

P: n/a
LDD
I have VB.Net project that I'm working on.

This morning, when I loaded the project, and clicked on the main form for
the project to view in designer mode. I get the following error

Property accessor 'IsMdiContainer' on object
'System.Windows.Forms.Design.FormDocumentDesigner' threw the following
exception:'Specified cast is not valid.'
I've googled it. There is a sugestion to set the Copy Local property for the
System.Windows.Forms reference to false. and restart the project

When I do that, the controls on my form are no longer as they were. My form
is smaller. the menubar is gone. and my grid has shrunk, because the form
has shrunk. when I resize the form the grid resizes, but I don't know what
happen to the menu bar.

Any ideas why this is happeneing?
And maybe a solution?

LDD
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
LDD wrote:
I have VB.Net project that I'm working on.

This morning, when I loaded the project, and clicked on the main form for
the project to view in designer mode. I get the following error

Property accessor 'IsMdiContainer' on object
'System.Windows.Forms.Design.FormDocumentDesigner' threw the following
exception:'Specified cast is not valid.'
I've googled it. There is a sugestion to set the Copy Local property for the
System.Windows.Forms reference to false. and restart the project

When I do that, the controls on my form are no longer as they were. My form
is smaller. the menubar is gone. and my grid has shrunk, because the form
has shrunk. when I resize the form the grid resizes, but I don't know what
happen to the menu bar.

Any ideas why this is happeneing?
And maybe a solution?

LDD


Do you inherit from a sub form in this project? Do you do anything in
OnPaint override? Do you do some code in the Sub New()?

If yes to any of those the problem is probably in there. The designer
fires these events to display the form in the designer. You can stop
this from happening by wrapping the code causing the problem with:

If Not Me.DesignMode Then

End If

Just a thought
Chris
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.