Windows Develop Bookmark and Share   
 index > Windows Forms Designer > What's wrong with the designer ?
 

What's wrong with the designer ?

I have an app which is bult around lots of user controls on a main form. When I moved to 2005, I had immediate trouble, the IDE would crash when I tried to open design view. In that instance, I had a Bitmap property, which defaulted to null, and which my code validated as not null before using it. The designer would stuff in a bitmap with PixelFormat.Undetermined, which broke the code, and blew up the IDE. I've had various problems like this.

The latest one is interesting tho. I have a control, and the code in InitializeComponents for this control reports a null reference exception. I need to open the design view, close it, go and delete the line, then open it again to get a design view for my app. The line in question is about the 6th property being set on the control ( so the control itself is not null ), and the property being set is Size. My control does not override this property.

It's my opinion that the design view is user hostile and fundamentally broken. I spend as much time fighting it as I do writing code. At no point has my app failed to run without errors, none of the design time problems equate to actual problems in the code.

Has anyone else found this ?

cgraus  Sunday, January 29, 2006 9:20 PM
I'm finding a similar problem (see http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=228789&SiteID=1 for my example) with the Windows Forms Designer.

The solution that's worked for me so far is to put a null check around the offending code once I've isolated the element. It by far not what I want to be doing, but when each project has a hard budget in time and money the last thing I'm going to do is waste time trying to hammer VS into letting me see the form when an IF variable != NULL statement will fix it.

Roll on service pack 1.
racka4279  Wednesday, February 01, 2006 9:14 PM

My fear is, Microsoft are saying this is by design. I'm not sure they are going to change it, or service pack it.

I think there's a learning curve here, and it's a real pain with updating older projects, but I'm fine with writing new controls that don't cause this. I still think it should be able to be turned off, perhaps even with an attribute, so I could turn it off for old classes, for example when my project initially crashed the IDE whenever I tried to open the designer. That was a nightmare.

cgraus  Wednesday, February 01, 2006 9:22 PM

You can use google to search for other answers

Custom Search

More Threads

• Change the appearance of a ToolStripComboBox
• how can i use logical expression
• File Download - Security Warning when opening Winforms Designer
• Customize Tabpage
• MDI Child not loading correct
• Best Practices Question
• Can sub-properties be hidden from the property grid?
• Help Adding Data Please!!!!
• How to get rid of focus rectangle?
• Fonts not quite rendering the same between Design and Runtime