all groups > dotnet windows forms designtime > july 2006 >
You're in the

dotnet windows forms designtime

group:

Cannot open a form in the IDE of VS2005


Cannot open a form in the IDE of VS2005 Juan Dent
7/17/2006 4:10:02 PM
dotnet windows forms designtime: Hi,

I have a Windows forms app with some user defined visual components in it
and for some reason I cannot open it in VS2005 IDE. If I build it, it will
run okay.

What could be going on and how can I go about debugging the problem?
The biggest problem is that VS2005 will hang every time I try to open the
form in design time.
--
Thanks in advance,

RE: Cannot open a form in the IDE of VS2005 v-lliu NO[at]SPAM online.microsoft.com
7/18/2006 1:53:34 AM
Hi Juan,

Thank you for posting.

Do you mean that you couldn't open the form that has some user controls on
it in the designer?

When a form with a user control on it is displayed in the designer, VS IDE
will call the code in the user control's constructor and event handler for
the user control's Load event.

So you shouldn't place any code regarding connecting database or any
operation on the database in the user control's constructor and event
handler for the user control's Load event.

Besides, if there's only one constructor in the user control class, the
constructor shouldn't take any parameter. If you need pass parameters in
the constructor, you could add a constructor which has no parameter.

Hope this helps.
Please try my suggestions and let me know the result.


Sincerely,
Linda Liu
Microsoft Online Community Support

============================================================================
=============================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

============================================================================
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
RE: Cannot open a form in the IDE of VS2005 Juan Dent
7/18/2006 2:19:02 PM
Hi,

Your comments were very helpfull. I wonder if there is a way to know if the
control is in design time or runtime?
So that we can code around...
--
Thanks in advance,

Juan Dent, M.Sc.


[quoted text, click to view]
RE: Cannot open a form in the IDE of VS2005 v-lliu NO[at]SPAM online.microsoft.com
7/19/2006 12:00:00 AM
Hi Juan,

Thank you for your response.

There's a property of Component called DesignMode. This property gets a
value that indicates whether the Component is currently in design mode. If
the Component is in design mode, the value of the property is true;
otherwise, false.

Since UserControl is inherited from Component in hiberarchy, UserControl
aslo has DesignMode property. You could use this property to know whether
the UserControl is in design mode.

Hope this helps.
If you have anything unclear, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support
AddThis Social Bookmark Button