I'm doing a WinForms UserControl and my property settings in design
mode don't seem to be persisting at all.
The deal is, I've got a BUNCH of screens that are pretty much the same,
so I made a UserControl (with a bunch of fields on it that can be
turned on and off via propertys and methods) and dropped copies of it
on several tabs of a TabControl.
Then, when I set their settings in design mode, they seem to stick, but
then I run the app and ... poof, nothing's right. All the settings are
out the window. In fact, its even ignoring the default settings I have
set up in the UC's code using ResetPROPNAME() and
ShouldSerializePROPNAME().
Any suggestions, help, whatever greatly appreciated!
Thanks,
-S
Scott F. - 14 Sep 2006 18:03 GMT
Hey Microsoft.. is it ok with you guys that these are the kinds of
comments being made about usercontrols?!
<ME> Visual Studio 2005 is a complete PIECE OF POO when dealing with
UserControls on TabControl pages.
<Coder #1> amen!
<Coder #2> you could just drop the 'on TabControl pages' qualifier on
that....
<ME> so.. usercontrols are f%^ked eh?
<ME> I mean... apparently they are.
<ME> this is SO f'ed.
<ME> I've got ELEVEN tabs with screens/contents SO similar, I wrote a
user control. But no, apparently I'm not allowed to do this.
<ME> I even moved the uc out to its own project, no help. Still f'ed.
<Coder #2> well I mean usercontrols work as designed, as long as you
don't attempt to use the designer with them *at all*
<ME> its like, it does the opposite of all of my properties defaults.
<Coder #2> but the designer f.cks them over something fierce
<ME> yes, thats .. apparent now.
<ME> wtf?!
<ME> Do they know about this horrid bug?
<Coder #2> *shrug*...it was worse in 2003...
Now, it turns out that Coder #2 was talking about usercontrols (uc) in
ASP.Net, but what I have found is that its true for winforms uc's as
well! The problem below is apparently a HUGE BUG in VS '05's forms
designer. Each time I get one usercontrol all set up on one tab page,
then try to drop another instance onto another, the last one's
properties are all switched to the OPPOSITE of their defaults etc.
Sure wish I knew how to at least work around this. I have tried to
simply go into the forms .designer.cs file and fix things there and NOT
touch anything through the visual designer etc. (which, needless to say
SHOULD work properly), but even that fails.
Very sad,
-S
> I'm doing a WinForms UserControl and my property settings in design
> mode don't seem to be persisting at all.
[quoted text clipped - 14 lines]
> Thanks,
> -S