Home All Groups Group Topic Archive Search About

Transparent Form And Visible Line Drawn.

Author
14 Jun 2006 8:56 AM
Lucile
Hi All,

I am trying to obtain some sort of a "Model" based on horizontal &
vertical lines (like a frame) drawn on a form or on a PictureBox. For
frames configuration purposes, I created a white background image; and
that works fine. But the "Model" will be used to cut off pieces of a
given image with MS Office. I would therefore like that the lines be
appearent on the image to be cut; but the the underlying control be
transparent (so as not to hide the image!).

I looked for a Transparent property on the form but found nothing; and
visible=False makes the lines disappear as well.

Any idea is welcome!

Cheers.

Author
14 Jun 2006 9:11 AM
R. MacDonald
Hi, Lucile,

Have you looked at the "SetStyle" method?

I have used the following within the constructor for setting up a
transparent control.

     Me.SetStyle(ControlStyles.AllPaintingInWmPaint Or _
                 ControlStyles.DoubleBuffer Or _
                 ControlStyles.SupportsTransparentBackColor Or _
                 ControlStyles.UserPaint, True)
     Me.UpdateStyles()
     Me.BackColor = Color.Transparent

Hope that helps a bit.

Cheers,
Randy


Lucile wrote:

Show quoteHide quote
> Hi All,
>
> I am trying to obtain some sort of a "Model" based on horizontal &
> vertical lines (like a frame) drawn on a form or on a PictureBox. For
> frames configuration purposes, I created a white background image; and
> that works fine. But the "Model" will be used to cut off pieces of a
> given image with MS Office. I would therefore like that the lines be
> appearent on the image to be cut; but the the underlying control be
> transparent (so as not to hide the image!).
>
> I looked for a Transparent property on the form but found nothing; and
> visible=False makes the lines disappear as well.
>
> Any idea is welcome!
>
> Cheers.
>