I have created a transparent control and I am using to to create drawing objects Inside the transparent objects I have created I am trying to using the draw shapes oval, rectangle etc. An example would be like in word are when you drag an oval onto the screen, the drawing resizes as the control does. The problem I am running into is actually drawing the rectangle. I am attempting to use this code here:

Rect = new Rectangle(this.Bounds.X - 10, (this.Bounds.Y -10), (this.Bounds.Width - 10), (this.Bounds.Height - 10))

I have placed this code in the Resize event. It does draw, however it seems to be reponsive to the bounds of it's container rather then the form itself. What I could like is if someone can help me figure out how to draw a rectangle close to the edges of the custom control and the drawing would resize itself as the form does. Please help!!! If anyone has any examples please email them mikestarkey@hotmail.com

Re: Drawing Issue by Ed

Ed
Fri Feb 06 19:18:50 CST 2004

How are you acquiring the Graphics object? You'll probably need to call
this.Parent.CreateGraphics() if you want to draw on the container.

"Mike Starkey" <mikestarkey@hotmail.com> wrote in message
news:939B7DB4-A2A5-4520-BDCC-2D1C28116B5B@microsoft.com...
> I have created a transparent control and I am using to to create drawing
objects Inside the transparent objects I have created I am trying to using
the draw shapes oval, rectangle etc. An example would be like in word are
when you drag an oval onto the screen, the drawing resizes as the control
does. The problem I am running into is actually drawing the rectangle. I
am attempting to use this code here:
>
> Rect = new Rectangle(this.Bounds.X - 10, (this.Bounds.Y -10),
(this.Bounds.Width - 10), (this.Bounds.Height - 10));
>
> I have placed this code in the Resize event. It does draw, however it
seems to be reponsive to the bounds of it's container rather then the form
itself. What I could like is if someone can help me figure out how to draw
a rectangle close to the edges of the custom control and the drawing would
resize itself as the form does. Please help!!! If anyone has any examples
please email them mikestarkey@hotmail.com