|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Why does my USER CONTROL keep disappearing ?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 Probably there's a bug in your control's design time components. Are you
using designer classes or typeconverters? Can you post some code? Show quoteHide quote "Lee Gillie" <Lee@nospam.odp.com> wrote in message news:ulRu4eY$EHA.208@TK2MSFTNGP12.phx.gbl... > 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 wrote:
> Probably there's a bug in your control's design time components. Are you Joey -> using designer classes or typeconverters? Can you post some code? > 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 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... Show quoteHide quote "Lee Gillie" <Lee@nospam.odp.com> wrote in message news:ulRu4eY$EHA.208@TK2MSFTNGP12.phx.gbl... > 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 Thanks Cheese -
I'll not focus some much time to trying to mitigate something that is a problem in the platform. Best regards - Lee WineNCheese wrote: Show quoteHide quote > 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... > > > "Lee Gillie" <Lee@nospam.odp.com> wrote in message > news:ulRu4eY$EHA.208@TK2MSFTNGP12.phx.gbl... > >>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 > > >
Other interesting topics
No touch deployment - IEEXEC won't fire up
No popup event when using shortcuts in context menu How can one select from overlapped panels in the form design View? Changing Treeview's selectedNode in Afterselect event. Error lost in databinding DateTimePicker events datagrid navigation Check-boxes on TreeNodes Determine Selected Rows in DataGrid C# SteadySelection Class |
|||||||||||||||||||||||