Parent UserControl fails to draw when child UserControl is updated.
-
I've got a UserControl that contains a panel, that is meant to contain other controls but only of a certain type. This type is another UserControl that implements a specific interface. Now I can add this child UserControl and it displays ok. But none of controls on the child user control display, and when I update a property of one of those controls (say the .Text) my parent control stops being drawn (big red cross :(), the child UserControl is still drawn though. Any ideas...I think its either a setting on Parent UserControl, or maybe an interface I'm missing.
-
I've got a UserControl that contains a panel, that is meant to contain other controls but only of a certain type. This type is another UserControl that implements a specific interface. Now I can add this child UserControl and it displays ok. But none of controls on the child user control display, and when I update a property of one of those controls (say the .Text) my parent control stops being drawn (big red cross :(), the child UserControl is still drawn though. Any ideas...I think its either a setting on Parent UserControl, or maybe an interface I'm missing.
Are you doing any drawing yourself or just relying on the controls to draw themselves?? If your code is taking too long to do anything during a repaint, you can get the Big Red X. If your code is doing custom drawing, then you either didn't use the Graphics object that was passed in through the PaintEventArgs or, you borked up the Graphics object somehow, or your code took too long to draw, or ... this list goes on and on. Without seeing your drawing code, it's pretty much impossible to pinpoint what went wrong.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Are you doing any drawing yourself or just relying on the controls to draw themselves?? If your code is taking too long to do anything during a repaint, you can get the Big Red X. If your code is doing custom drawing, then you either didn't use the Graphics object that was passed in through the PaintEventArgs or, you borked up the Graphics object somehow, or your code took too long to draw, or ... this list goes on and on. Without seeing your drawing code, it's pretty much impossible to pinpoint what went wrong.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak