I am creating a custom control and I'm trying to get the painting of
it correct. I'd like to simply use:
e.Graphics.Fill Rectangle(Brush es.White, DisplayRectangl e);
.... or ...
e.Graphics.Fill Rectangle(Brush es.White, ClientRectangle );
.... or ...
e.Graphics.Fill Rectangle(Brush es.White, Bounds);
But each of those fails to draw a rectangle all the way around (most
are 1 pixel off). Instead I find myself having to use:
e.Graphics.Fill Rectangle(Brush es.White, DisplayRectangl e.X,
DisplayRectangl e.Y, DisplayRectangl e.Width - 1,
DisplayRectangl e.Height - 1);
What am I really supposed to use? How do I get that last pixel
correct?
Tom P.
it correct. I'd like to simply use:
e.Graphics.Fill Rectangle(Brush es.White, DisplayRectangl e);
.... or ...
e.Graphics.Fill Rectangle(Brush es.White, ClientRectangle );
.... or ...
e.Graphics.Fill Rectangle(Brush es.White, Bounds);
But each of those fails to draw a rectangle all the way around (most
are 1 pixel off). Instead I find myself having to use:
e.Graphics.Fill Rectangle(Brush es.White, DisplayRectangl e.X,
DisplayRectangl e.Y, DisplayRectangl e.Width - 1,
DisplayRectangl e.Height - 1);
What am I really supposed to use? How do I get that last pixel
correct?
Tom P.
Comment