I want to put a label control above 2 different pictureboxes ( both with
gradient images). Is it possible to create a transparent label? The
background of the label should show images in pictureboxes, or even form color

Re: transparent label i CF 3.5 by Peter

Peter
Fri Jul 18 13:24:16 CDT 2008

This is not possible with the standard Label control. However you can
achieve this effect by drawing both the image and the text directly onto
your form by handling the Paint event.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - Software Solutions for a Mobile World
In The Hand Ltd - .NET Components for Mobility

"Chris" <Chris@discussions.microsoft.com> wrote in message
news:C0A4D95D-52DF-4AAC-B8D9-DC6E5139C823@microsoft.com...
>I want to put a label control above 2 different pictureboxes ( both with
> gradient images). Is it possible to create a transparent label? The
> background of the label should show images in pictureboxes, or even form
> color


Re: transparent label i CF 3.5 by Chris

Chris
Fri Jul 18 17:17:01 CDT 2008

Ok, I have created a control that inherits from Control class. I can handle
OnPaint and OnPantBackground methods. ca also draw string with text. The
problem is how to draw a background (I mean appearance of controls my label
is above on)

Re: transparent label i CF 3.5 by Peter

Peter
Fri Jul 18 17:45:15 CDT 2008

You can't make your control transparent to show other controls beneath. You
need to draw your images and text within a single OnPaint either in directly
in your form or a single custom control. Use the DrawImage to draw the
bitmap first then DrawString to place the text above it.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - Software Solutions for a Mobile World
In The Hand Ltd - .NET Components for Mobility

"Chris" <Chris@discussions.microsoft.com> wrote in message
news:6AF09C70-B4CA-4CD9-9255-5BDF59F7C851@microsoft.com...
> Ok, I have created a control that inherits from Control class. I can
> handle
> OnPaint and OnPantBackground methods. ca also draw string with text. The
> problem is how to draw a background (I mean appearance of controls my
> label
> is above on)


Re: transparent label i CF 3.5 by Achim

Achim
Sat Jul 19 02:50:07 CDT 2008

Hi!

take a look at
http://christian-helle.blogspot.com/2008/01/transparent-controls-in-netcf.html

this seems to be a good approach for your problem...

hth,
greetings
Achim

Chris wrote:
> I want to put a label control above 2 different pictureboxes ( both with
> gradient images). Is it possible to create a transparent label? The
> background of the label should show images in pictureboxes, or even form color

Re: transparent label i CF 3.5 by Chris

Chris
Sat Jul 19 02:52:00 CDT 2008

I understand but how to solve that problem: put a label on picturebox. How to
make the label transparent? I do not want to draw string directly on the
picturebox.
I know I have to draw image as background of the label - but the problem is
how to get that image? If I put the label on other control I would like to
get image of the control beneath the label and then draw it as label
background. But again - how to get that image?

Re: transparent label i CF 3.5 by srhartone

srhartone
Sun Jul 20 01:22:01 CDT 2008

Try something like the following:

Graphics grfx = Graphics.FromImage(pictureBox1.Image);
grfx.DrawString("Some transparent text", this.Font, new
SolidBrush(Color.Black), 20, 20 );

Where pictureBox1 is your picture box control.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


"Chris" wrote:

> I understand but how to solve that problem: put a label on picturebox. How to
> make the label transparent? I do not want to draw string directly on the
> picturebox.
> I know I have to draw image as background of the label - but the problem is
> how to get that image? If I put the label on other control I would like to
> get image of the control beneath the label and then draw it as label
> background. But again - how to get that image?

Re: transparent label i CF 3.5 by Christian

Christian
Sun Jul 20 15:32:05 CDT 2008

I wrote an article some time ago regarding transparent controls in .NETCF
http://christian-helle.blogspot.com/2008/01/transparent-controls-in-netcf.html

Maybe it could help you out

--
Regards,
Christian Resma Helle
http://christian-helle.blogspot.com


"Chris" <Chris@discussions.microsoft.com> wrote in message
news:C0A4D95D-52DF-4AAC-B8D9-DC6E5139C823@microsoft.com...
>I want to put a label control above 2 different pictureboxes ( both with
> gradient images). Is it possible to create a transparent label? The
> background of the label should show images in pictureboxes, or even form
> color


Re: transparent label i CF 3.5 by Christian

Christian
Sun Jul 20 15:56:49 CDT 2008

My apologies for double posting that link. I didn't see that Achim Bohmann
already posted it yesterday,

--
Regards,
Christian Resma Helle
http://christian-helle.blogspot.com


"Christian Resma Helle" <xtianism@gmail.com> wrote in message
news:1BAF506A-7057-448C-A684-468CF42B422C@microsoft.com...
>I wrote an article some time ago regarding transparent controls in .NETCF
> http://christian-helle.blogspot.com/2008/01/transparent-controls-in-netcf.html
>
> Maybe it could help you out
>
> --
> Regards,
> Christian Resma Helle
> http://christian-helle.blogspot.com
>
>
> "Chris" <Chris@discussions.microsoft.com> wrote in message
> news:C0A4D95D-52DF-4AAC-B8D9-DC6E5139C823@microsoft.com...
>>I want to put a label control above 2 different pictureboxes ( both with
>> gradient images). Is it possible to create a transparent label? The
>> background of the label should show images in pictureboxes, or even form
>> color
>