S
Simon Tamman
Hi,
Re-posting this as the formatting on the other post is terrible.
If I inherit from a control with the following OnPaint override and draw in
the DoPaint method then i get odd UI results when a combobox is dropped down
on top of the control and then removed. I use this code in CE as well where
the problem is greater due to the loading circle and the volume control boxes
that pop-up.
This problem is reproducible on the desktop though. A full example is posted
afterwards for you to copy -> paste and see the issue yourself.
Any help would be appreciated as the code looks fine to me (am I an idiot?)
protected override void OnPaint(PaintEventArgs e)
{
if (e.ClipRectangle.Width > 0 && e.ClipRectangle.Height > 0)
{
using (m_BackBuffer = new Bitmap(e.ClipRectangle.Width,
e.ClipRectangle.Height))
{
using (m_BackGraphics = Graphics.FromImage(m_BackBuffer))
{
DoPaint(new PaintEventArgs(m_BackGraphics, e.ClipRectangle));
}
e.Graphics.DrawImage(m_BackBuffer, 0, 0);
}
}
}
Re-posting this as the formatting on the other post is terrible.
If I inherit from a control with the following OnPaint override and draw in
the DoPaint method then i get odd UI results when a combobox is dropped down
on top of the control and then removed. I use this code in CE as well where
the problem is greater due to the loading circle and the volume control boxes
that pop-up.
This problem is reproducible on the desktop though. A full example is posted
afterwards for you to copy -> paste and see the issue yourself.
Any help would be appreciated as the code looks fine to me (am I an idiot?)
protected override void OnPaint(PaintEventArgs e)
{
if (e.ClipRectangle.Width > 0 && e.ClipRectangle.Height > 0)
{
using (m_BackBuffer = new Bitmap(e.ClipRectangle.Width,
e.ClipRectangle.Height))
{
using (m_BackGraphics = Graphics.FromImage(m_BackBuffer))
{
DoPaint(new PaintEventArgs(m_BackGraphics, e.ClipRectangle));
}
e.Graphics.DrawImage(m_BackBuffer, 0, 0);
}
}
}