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 / January 2005

Tip: Looking for answers? Try searching our database.

Why does my USER CONTROL keep disappearing ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lee Gillie - 18 Jan 2005 18:01 GMT
I'm not sure what causes it, but occasionally my USER CONTROL half way
disappears from the form I am working on. I detect design mode and have
an innocuous gradient fill paint for that, which does not interact with
the control heavily. When it goes, it doesn't completely go, there is
still a control variable for it, but the code to instance it, and
initialize its properties goes away. The program can not run, of course,
with no instance. And I can not add the control now. I exit IDE, come
back in, add the control again, and then have to play some
search/replace games to get the name of UC2 back to UC1.

Can I fix it? Can I avoid it? What causes it?

Best regards - Lee Gillie, Spokane WA
joeycalisay - 19 Jan 2005 01:26 GMT
Probably there's a bug in your control's design time components.  Are you
using designer classes or typeconverters?  Can you post some code?

Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> I'm not sure what causes it, but occasionally my USER CONTROL half way
> disappears from the form I am working on. I detect design mode and have
[quoted text clipped - 9 lines]
>
> Best regards - Lee Gillie, Spokane WA
Lee Gillie - 19 Jan 2005 17:08 GMT
> Probably there's a bug in your control's design time components.  Are you
> using designer classes or typeconverters?  Can you post some code?

Joey -

I do not understand your question about designer classes or
typeconverters. This is a usercontrol with a couple of scroll bars, and
a custom client area paint override.

I really can't post code, but I can say I override a lot of mouse and
other OnXXX handlers. I always invoke the base-class on-handlers in my
override. The only OnXXX handler that I have made sensitive to being in
design mode is the paint routine, in which I use a simple paint that
does not utilize the runtime state of the object. Maybe there are more
on-handlers being called in design mode than I realize?

I think I need to explore the docs more for techniques to debug
design-time behaviour.  I don't get any error messages, which may give
some hints, the damn thing just disappears, and only half-way.

Thanks for giving some hints/direction here.

Best regards - Lee
WineNCheese - 19 Jan 2005 18:42 GMT
This seems to prevent the issue for me: Don't ever open the form in design
view if there is not a compiled version of the assembly available.  In other
words, always compile before opening the form in design view.

If the control is not being deleted, you can take a look in your .resx file
for the form, and you will probably notice the size of the control has been
changed to 0,0 or something annoying like that.  This is a well discussed
problem.  Hopefully the next version does something to address this.  I know
I've spent countless hours battling this same issue in the past...

> I'm not sure what causes it, but occasionally my USER CONTROL half way
> disappears from the form I am working on. I detect design mode and have an
[quoted text clipped - 9 lines]
>
> Best regards - Lee Gillie, Spokane WA
Lee Gillie - 19 Jan 2005 20:44 GMT
Thanks Cheese -

I'll not focus some much time to trying to mitigate something that is a
problem in the platform.

Best regards - Lee

> This seems to prevent the issue for me: Don't ever open the form in design
> view if there is not a compiled version of the assembly available.  In other
[quoted text clipped - 19 lines]
>>
>>Best regards - Lee Gillie, Spokane WA

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.