(Due to absolutely no response in ms.pub.dotnet.general, I'm reposting
here...)
When I call the following function, the rectangle will overlap the
graphics that is drawn _afterwards_. Why is that? How can I make sure
my graphics is drawn in correct order?
(Note: If I comment the FillRectangle-line, the other graphics is drawn
correctly.)
private void PaintBox(Graphics g, Brush b, Pen p)
{
// The background rectangle...
g.FillRectangle(b, mBoxRectangle);
// The foreground graphics...
switch (mRegionInfo.Box)
{
case RegionInfo.BoxState.Empty:
break;
case RegionInfo.BoxState.Crossed:
g.DrawLine(p, ...);
g.DrawLine(p, ...);
break;
case RegionInfo.BoxState.Circled:
g.DrawEllipse(p, ...);
break;
}
}