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 / WinForm General / June 2006

Tip: Looking for answers? Try searching our database.

Microsoft has let me down -- form breaks in designer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel Manes - 01 Jun 2006 18:58 GMT
Sorry for cross-posting this all over the place, but I've already lost
two days to this problem, and I'm at my wits end. I've searched the
usenet archives up and down and tried everything I can think of, but I
just can't get the Visual Studio designer to stop breaking on me.

My problem is that, when I open my form in the designer, I get an error
dialog, and then when I accept the dialog, one of the TabPages of the
TabControl is broken--there's an error message with a big red X
plastered all over it.

This happens even though I've just been using the designer (i.e., the
GUI). I haven't written a single line of code yet.

I can't reproduce exactly what I did (too many steps), but here's a
rundown of what happened (with links to screen captures):

== If you need more info to help me, please ask and I'll provide
whatever I can. ==
1. Create TabControl (contains Tab1 and Tab2)
2. Place a bunch of controls
3. Add data bindings for two DataGridViews (one on Tab1, one on Tab2)
== everything fine so far ==
4. Add a new tab (Tab3 -- no controls)
== still fine ==
5. Move Tab3 to beginning (new order: Tab3, Tab1, Tab2)
== stops working! ==

When I open the form, I get this error dialog:
http://members.cox.net/danthman/pictures/VSErrorDialog.jpg

Then, when I hit OK, the form is broken.
http://members.cox.net/danthman/pictures/VSBrokenForm.jpg

6. Remove Tab3
== works fine again ==
7. Add two new tabs
8. Move both tabs to the beginning (new order: Tab3, Tab4, Tab1, Tab2)
== stops working again ==

At this point, the document outline looks like this:
http://members.cox.net/danthman/pictures/VSDocumentOutline.jpg

9. Remove both tabs
== works fine again ==
10. Remove data bindings
11. Add a new tab
12. Move tab to beginning
== still works fine ==
13. Add data bindings
== stops working again ==

Thanks,

Dan

P.S. Not sure if html works here, but here are the links in html:
<a
href="http://members.cox.net/danthman/pictures/VSErrorDialog.jpg>Error
Dialog</a>
<a
href="http://members.cox.net/danthman/pictures/BrokenForm.jpg>BrokenForm</a>
<a
href="http://members.cox.net/danthman/pictures/VSDocumentOutline.jpg>DocumentOutline</a>
JP - 02 Jun 2006 18:26 GMT
This occurs when the the designer partial class code
(Form1.designer.cs) breaks.  Take a look there in the "Windows Form
Designer generated code" for two definitions of the offending control.
Its likely you added the control, removed a panel, then readded again
and the designer code didn't keep up with the activity.  Hope this
helps.
Daniel Manes - 02 Jun 2006 22:04 GMT
Hi JP,

Thanks, but I'm pretty sure that's not the problem. Only one
declaration/instance of the offending control shows up in the designer
code. Also, I've actually rebuilt this form from scratch several times
(including using a brand new project), but I always get the same error.
The error even occurs if I add all the controls sequentially and
without moving, copying, pasting, deleting or doing anything else that
might confuse the designer.

So, I've now submitted a bug report to Microsoft. Hopefully the problem
will be solved in a future release. Meanwhile, anyone experiencing this
problem will either have to either live with not being able to see
what's on certain tab pages or temporarily removing the bindings from
problematic tab pages. Fortunately, I discovered after some recent
testing that the form actually compiles without errors and runs--it's
strictly a problem with design mode.

Thanks again for taking a look at this,

-Dan
Bruce Wood - 03 Jun 2006 00:53 GMT
> Hi JP,
>
[quoted text clipped - 17 lines]
>
> -Dan

I know that this is probably a lame suggestion, but...

... could you create a UserControl that contains all of the stuff on a
tab page, do the bindings in your UserControl, then just place the
UserControl on the TabPage?

That would avoid having to do everything all in one form, which might
get around your designer bug.
havish14@gmail.com - 21 Jun 2006 21:32 GMT
Did you try installing the latest hotfix for VS2005 on your system. I
had a similar kind of problem with the designer but it went away after
I installed the hotfix.

> Hi JP,
>
[quoted text clipped - 17 lines]
>
> -Dan

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.