Compact Framework 2.0, transparent label over picture box

S

Steven Tang

I'm creating a .NET for Windows Mobile and using CF2.0, I tried to
set the background of a label which is over a picturebox to transparent
by changed its backColor to Transparent, but it doesn't work
during the run time, the label still has white background, anyway
to make it work?
 
J

Jie Wang [MSFT]

Hello Steven,

Since this is a .NET Compact Framework question, I'd suggest you post it in
the Compact Framework newsgroup. You will find more qualified CF experts
and get better support there from the community. The newsgroup for .NET CF
is:

microsoft.public.dotnet.framework.compactframework

Thank you and I appreciate your understanding.

Besides, I'd still like to share some of my thoughts on this problem.

If this was on Windows Desktop, we can use a Panel control to contain a
picture instead of a PictureBox to make a Label control with background
color set to transparent work. This works because .NET will try to
*simulate* transparency, not because Windows supports this feature
natively. You may want to read the document on BackColor property for more
information (especially the Remark section):
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.backcol
or(VS.80).aspx

However, this technique seems not working with CF. So I believe we
basically have two options:

1. Make our own custom Label control to support transparent background.

2. Do not use a label control at all, use DrawString method to paint the
string directly onto the picture.
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawstring(V
S.80).aspx

Regards,

Jie Wang ([email protected], remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Tang

Thank, I will create the customize label instead of the standard label.
--
=======================
Steven Tang
SYWWUYU)
**:)


"Jie Wang [MSFT]" said:
Hello Steven,

Since this is a .NET Compact Framework question, I'd suggest you post it in
the Compact Framework newsgroup. You will find more qualified CF experts
and get better support there from the community. The newsgroup for .NET CF
is:

microsoft.public.dotnet.framework.compactframework

Thank you and I appreciate your understanding.

Besides, I'd still like to share some of my thoughts on this problem.

If this was on Windows Desktop, we can use a Panel control to contain a
picture instead of a PictureBox to make a Label control with background
color set to transparent work. This works because .NET will try to
*simulate* transparency, not because Windows supports this feature
natively. You may want to read the document on BackColor property for more
information (especially the Remark section):
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.backcol
or(VS.80).aspx

However, this technique seems not working with CF. So I believe we
basically have two options:

1. Make our own custom Label control to support transparent background.

2. Do not use a label control at all, use DrawString method to paint the
string directly onto the picture.
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawstring(V
S.80).aspx

Regards,

Jie Wang ([email protected], remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jie Wang [MSFT]

Hi Steven,

Good to know you're going to create your own customized control. One of the
advantages of creating such a control over drawing string directly is that
we can reuse it easily.

Thank you for sharing with us and have a nice day.

Best regards,

Jie Wang ([email protected], remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
N

nilangini

Thank, I will create the customize label instead of the standard label.
--
=======================
Steven Tang
SYWWUYU)
**:)



"Jie Wang [MSFT]" said:
Hello Steven,
Since this is a .NET Compact Framework question, I'd suggest you post it in
the Compact Framework newsgroup. You will find more qualified CF experts
and get better support there from the community. The newsgroup for .NETCF
is:

Thank you and I appreciate your understanding.
Besides, I'd still like to share some of my thoughts on this problem.
If this was on Windows Desktop, we can use a Panel control to contain a
picture instead of a PictureBox to make a Label control with background
color set to transparent work. This works because .NET will try to
*simulate* transparency, not because Windows supports this feature
natively. You may want to read the document on BackColor property for more
information (especially the Remark section):
http://msdn.microsoft.com/en-us/library/system.windows.forms.control....
or(VS.80).aspx
However, this technique seems not working with CF. So I believe we
basically have two options:
1. Make our own custom Label control to support transparent background.
2. Do not use a label control at all, use DrawString method to paint the
string directly onto the picture.
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.draws...
S.80).aspx

Jie Wang ([email protected], remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notificat.....
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.- Hide quoted text -

- Show quoted text -

If you already have done this, could you please post the code?

Thanks,
Nilangini
 
Joined
Jun 12, 2009
Messages
1
Reaction score
0
Comact Framework 2.0 transparent controls

If you are interested in transparent controls on .NET Compact Framework 2.0 consider bee Mobile controls which provide attractive GUI for reasonable price. TransparentControls is a set of controls which supports transparency. You can find more information on their web page at: http://www.beemobile4.net

Best regards,
Peter Salamon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top