Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / July 2006

Tip: Looking for answers? Try searching our database.

Cannot open a form in the IDE of VS2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Juan Dent - 18 Jul 2006 00:10 GMT
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.
Signature

Thanks in advance,

Juan Dent, M.Sc.

Linda Liu [MSFT] - 18 Jul 2006 02:53 GMT
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.
Juan Dent - 18 Jul 2006 22:19 GMT
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...
Signature

Thanks in advance,

Juan Dent, M.Sc.

> Hi Juan,
>
[quoted text clipped - 37 lines]
> =============================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
Linda Liu [MSFT] - 19 Jul 2006 04:54 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.