Is it possible to make the background color of controls (such as group
boxes, lables, text boxes and check boxes, tabpage ) to transparent?

In case you need more information, I have added some code to the form_paint
method to paint the background with a gradiant. I need to get the controls
on the form to match the same look. The only alternative I could come up
with was to create an image with the color gradiant, and setting that to the
background of the form and controls - which really seems to be a silly
approach.

Thanks for any help.

Derrick

Re: transparent controls by Eric

Eric
Sun Feb 29 17:58:18 CST 2004


"Derrick" <Derrick_no_spam@geostrategies.ca> wrote in message
news:cjr0c.647687$X%5.170677@pd7tw2no...
> Is it possible to make the background color of controls (such as group
> boxes, lables, text boxes and check boxes, tabpage ) to transparent?
>
> In case you need more information, I have added some code to the
form_paint
> method to paint the background with a gradiant. I need to get the
controls
> on the form to match the same look. The only alternative I could come up
> with was to create an image with the color gradiant, and setting that to
the
> background of the form and controls - which really seems to be a silly
> approach.
>
> Thanks for any help.
>
> Derrick
>
>

Did you try setting the backcolor to transparent on the controls? That
should do what you want. Click the controls backcolor in the property
window. It's towards the top of the Web tab in the color editor that pops
up.

HTH
Eric



Re: transparent controls by Derrick

Derrick
Sun Feb 29 18:35:28 CST 2004

Yep - the transparent Back color doesn't work with any controls that I have
seen. Using that setting makes all controls have the 'control' color
background in run time.

Derrick

"Eric Eggermann >" <<none> wrote in message
news:OPP2o$x$DHA.2516@TK2MSFTNGP11.phx.gbl...
>
> "Derrick" <Derrick_no_spam@geostrategies.ca> wrote in message
> news:cjr0c.647687$X%5.170677@pd7tw2no...
> > Is it possible to make the background color of controls (such as group
> > boxes, lables, text boxes and check boxes, tabpage ) to transparent?
> >
> > In case you need more information, I have added some code to the
> form_paint
> > method to paint the background with a gradiant. I need to get the
> controls
> > on the form to match the same look. The only alternative I could come
up
> > with was to create an image with the color gradiant, and setting that to
> the
> > background of the form and controls - which really seems to be a silly
> > approach.
> >
> > Thanks for any help.
> >
> > Derrick
> >
> >
>
> Did you try setting the backcolor to transparent on the controls? That
> should do what you want. Click the controls backcolor in the property
> window. It's towards the top of the Web tab in the color editor that pops
> up.
>
> HTH
> Eric
>
>



Re: transparent controls by David

David
Sun Feb 29 19:26:16 CST 2004

Derrick wrote:

> Yep - the transparent Back color doesn't work with any controls that
> I have seen. Using that setting makes all controls have the
> 'control' color background in run time.

Could you post your form_paint code? I had a similar problem due to a
silly oversight on my part. Instead of using the Graphics object passed
in the PaintEventArgs, I was creating my own. End result; controls
didn't have transparent backgrounds.

--
Cheers,
David Clegg
dclegg_at_ebetonline_dot_com

"Vampires are make believe, just like elves and gremlins and
eskimos." - Homer Simpson

Re: transparent controls by Derrick

Derrick
Sun Feb 29 20:37:36 CST 2004

Here it is...

Private Sub frmMain_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim objBrush As New
Drawing2D.LinearGradientBrush(Me.DisplayRectangle, Color.White,
Color.CornflowerBlue, Drawing2D.LinearGradientMode.Vertical)
Dim objGraphics As Graphics = Me.CreateGraphics()
objGraphics.FillRectangle(objBrush, Me.DisplayRectangle)
objBrush.Dispose()
objGraphics.Dispose()
End Sub

Thanks

Derrick

"David Clegg" <dclegg@nospam.ebetonline.com> wrote in message
news:xn0df9azm7q3kl000@msnews.microsoft.com...
> Derrick wrote:
>
> > Yep - the transparent Back color doesn't work with any controls that
> > I have seen. Using that setting makes all controls have the
> > 'control' color background in run time.
>
> Could you post your form_paint code? I had a similar problem due to a
> silly oversight on my part. Instead of using the Graphics object passed
> in the PaintEventArgs, I was creating my own. End result; controls
> didn't have transparent backgrounds.
>
> --
> Cheers,
> David Clegg
> dclegg_at_ebetonline_dot_com
>
> "Vampires are make believe, just like elves and gremlins and
> eskimos." - Homer Simpson



Re: transparent controls by Derrick

Derrick
Sun Feb 29 20:47:44 CST 2004

And, thanks to David's great insight, I did find the problem... I modified
the paint method to:

Private Sub Form_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

Dim objBrush As New Drawing2D.LinearGradientBrush(Me.DisplayRectangle,
Color.White, Color.CornflowerBlue, Drawing2D.LinearGradientMode.Vertical)
e.Graphics.FillRectangle(objBrush, Me.DisplayRectangle)
objBrush.Dispose()

End Sub
Thanks for the help

Derrick

"Derrick" <Derrick_no_spam@geostrategies.ca> wrote in message
news:Qlx0c.633620$JQ1.399499@pd7tw1no...
> Here it is...
>
> Private Sub frmMain_Paint(ByVal sender As Object, ByVal e As
> System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
> Dim objBrush As New
> Drawing2D.LinearGradientBrush(Me.DisplayRectangle, Color.White,
> Color.CornflowerBlue, Drawing2D.LinearGradientMode.Vertical)
> Dim objGraphics As Graphics = Me.CreateGraphics()
> objGraphics.FillRectangle(objBrush, Me.DisplayRectangle)
> objBrush.Dispose()
> objGraphics.Dispose()
> End Sub
>
> Thanks
>
> Derrick
>
> "David Clegg" <dclegg@nospam.ebetonline.com> wrote in message
> news:xn0df9azm7q3kl000@msnews.microsoft.com...
> > Derrick wrote:
> >
> > > Yep - the transparent Back color doesn't work with any controls that
> > > I have seen. Using that setting makes all controls have the
> > > 'control' color background in run time.
> >
> > Could you post your form_paint code? I had a similar problem due to a
> > silly oversight on my part. Instead of using the Graphics object passed
> > in the PaintEventArgs, I was creating my own. End result; controls
> > didn't have transparent backgrounds.
> >
> > --
> > Cheers,
> > David Clegg
> > dclegg_at_ebetonline_dot_com
> >
> > "Vampires are make believe, just like elves and gremlins and
> > eskimos." - Homer Simpson
>
>



OT: Re: transparent controls by hirf-spam-me-here

hirf-spam-me-here
Mon Mar 01 09:16:36 CST 2004

* "David Clegg" <dclegg@nospam.ebetonline.com> scripsit:
[...]

Nice X-Face.

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>

Re: OT: Re: transparent controls by David

David
Mon Mar 01 15:48:29 CST 2004

Herfried K. Wagner [MVP] wrote:

> Nice X-Face.

<g>

Didn't help much during the RWC though. Oh well, at least LOTR cleaned
up the Oscars :-)

--
Cheers,
David Clegg
dclegg_at_ebetonline_dot_com

"Hello? Operator! Give me the number for 911!" - Homer Simpson