Re: Usable ClientRectangle for Form
- From: "Bit Twiddler" <bittwiddler35@xxxxxxxxxxx>
- Date: Sun, 10 Jul 2005 11:42:27 -0400
I don't know if this is the proper solution, but I ended up using a
transform on the graphics object to translate the drawing so that that is
automatically occurs UNDER the status bar:
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
// Start drawing BELOW the statusbar
Matrix matrix = new Matrix();
matrix.Translate(0, menuStrip1.Height);
g.Transform = matrix;
// Now (0,0) is below the statusbar
g.DrawRectangle(Pens.Red, 0, 0, ...);
...
"Bit Twiddler" <bittwiddler35@xxxxxxxxxxx> wrote in message
news:ew5xOHWhFHA.1244@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I am performing drawing directly on the surface of a WinForm (double
> buffering).
>
> My form has a menu, statusbar, etc.
>
> The ClientRectangle of my form includes the areas taken up by the menu,
> statusbar, etc. What I want to get is a rectangle that represents the
> area of the form where I need to do my drawing. Is there an easy way to
> get his rectangle or do I have to calculate it myself all the time?
>
> Thanks,
> BT
>
.
- Follow-Ups:
- Re: Usable ClientRectangle for Form
- From: Lloyd Dupont
- Re: Usable ClientRectangle for Form
- References:
- Usable ClientRectangle for Form
- From: Bit Twiddler
- Usable ClientRectangle for Form
- Prev by Date: Usable ClientRectangle for Form
- Next by Date: No double-buffering on a Panel?
- Previous by thread: Usable ClientRectangle for Form
- Next by thread: Re: Usable ClientRectangle for Form
- Index(es):
Relevant Pages
|