P
Peter Row
Hi,
Okay here is the setup:
- I have a Form which has 2 panels and a splitter on (options, content
panels).
- I have custom UserControl which has a panel on it and 2 buttons.
- On the above UserControl I do some painting I have tried putting it in:
- protected override void OnPaint(PaintEventArgs e)
- myControl_Paint(object sender, PaintEventArgs e)
- in constructor this.Paint += new
PaintEventHandler(myControl_Paint);
- UserControl has a resize event which calls this.Invalidate();
- I load the UserControl into one of the panels on the Form.
Problem:
Regardless of using either of the above methods the Paint event is NOT being
fired. The resize event is fired and executes this.Invalidate() with no
problems.
I have also tried setting the .ResizeRedraw property to true on the
UserControl
and then when that didn't work I also added it to the constructor of the
form
which has the panel the UserControl will be loaded into, but still nothing.
The really annoying thing is this UserControl use to function fine when I
was
first developing it as a test. Then I wrote the rest of the app, and now
that I
have come back to use my UserControl in the above scenario the Paint is just
not working. As a footnote the UserControl use to be in a class DLL now it
is in the main app .exe assembly.
Any help would be much appreciated as I'm at a complete loss.
Regards,
Peter
Okay here is the setup:
- I have a Form which has 2 panels and a splitter on (options, content
panels).
- I have custom UserControl which has a panel on it and 2 buttons.
- On the above UserControl I do some painting I have tried putting it in:
- protected override void OnPaint(PaintEventArgs e)
- myControl_Paint(object sender, PaintEventArgs e)
- in constructor this.Paint += new
PaintEventHandler(myControl_Paint);
- UserControl has a resize event which calls this.Invalidate();
- I load the UserControl into one of the panels on the Form.
Problem:
Regardless of using either of the above methods the Paint event is NOT being
fired. The resize event is fired and executes this.Invalidate() with no
problems.
I have also tried setting the .ResizeRedraw property to true on the
UserControl
and then when that didn't work I also added it to the constructor of the
form
which has the panel the UserControl will be loaded into, but still nothing.
The really annoying thing is this UserControl use to function fine when I
was
first developing it as a test. Then I wrote the rest of the app, and now
that I
have come back to use my UserControl in the above scenario the Paint is just
not working. As a footnote the UserControl use to be in a class DLL now it
is in the main app .exe assembly.
Any help would be much appreciated as I'm at a complete loss.
Regards,
Peter