Labels

P

Phill Shaw

I have a couple questions about labels...

1. I understand that labels are, by default, transparent and therefore show
the backcolor of the parent control. So when I change the backcolor
(label1.backcolor = system.drawing.color.blue) how do I actually show the
background?

2. I have the following code in my label1_Click event msgbox("hello
world")
When I run the code in the PocketPC 2003 emulator, the event never seems to
fire. Is that because I'm in the emulator or is there something 'special'
about the label's click event?

Thanks All -
ps
 
C

Chris Tacke, eMVP

Actually they're *not* transparent. They simply inherit a backcolor from
the parent. This means if it overlaps other controls, the other controls do
*not* show through.

The click event isn't supported in the RTM. I think it was added in SP1 or
2, though I honestly don't recall.

-Chris
 
P

Phill Shaw

understood, but how does one change the background color of a label?

I've been using label1.backcolor = drawing.color.blue AND label1.backcolor =
drawing.color.fromARGB(0,0,255) but neither works (for me). If I "Watch"
the label, I do see R=0, G=0, B=255 but the control is still "white".

I must be missing something, but I have no idea what...

thx again -
ps
 
C

Chris Tacke, eMVP

The BackColor property isn't supported in the RTM. Upgrade to SP2 and it
should work fine.

-Chris
 
J

Joe Bork [MSFT]

Hello Phil,

Neither the BackColor property nor the Click event are supported on the
Label control in the Compact Framework. Even though these appear in
Intellisense on the control, setting them does not have any effect.

The full list of supported properties, methods, and events for the Label
control is availble here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformslabelmemberstopic.asp

Any of the items denoted as "Supported by the .NET Compact Framework" are
available on devices.

--Joe

--
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Phill Shaw" <[email protected]>
| Subject: Labels
| Date: Sat, 10 Jan 2004 19:31:37 -0500
|
| I have a couple questions about labels...
|
| 1. I understand that labels are, by default, transparent and therefore
show
| the backcolor of the parent control. So when I change the backcolor
| (label1.backcolor = system.drawing.color.blue) how do I actually show the
| background?
|
| 2. I have the following code in my label1_Click event msgbox("hello
| world")
| When I run the code in the PocketPC 2003 emulator, the event never seems
to
| fire. Is that because I'm in the emulator or is there something 'special'
| about the label's click event?
|
| Thanks All -
| ps
|
|
|
 
J

Joe Bork [MSFT]

I should clarify my comments by saying that both the BackColor property and
the Click event should be available in SP2 of the Compact Framework. You
can download the SP2 redistributables here:

http://msdn.microsoft.com/mobility/downloads/updates/default.aspx

--Joe


--
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Phill Shaw" <[email protected]>
| Subject: Labels
| Date: Sat, 10 Jan 2004 19:31:37 -0500
|
| I have a couple questions about labels...
|
| 1. I understand that labels are, by default, transparent and therefore
show
| the backcolor of the parent control. So when I change the backcolor
| (label1.backcolor = system.drawing.color.blue) how do I actually show the
| background?
|
| 2. I have the following code in my label1_Click event msgbox("hello
| world")
| When I run the code in the PocketPC 2003 emulator, the event never seems
to
| fire. Is that because I'm in the emulator or is there something 'special'
| about the label's click event?
|
| Thanks All -
| ps
|
|
|
 
P

Phill Shaw

Well, the BackColor property seems to be supported with SP2. I'm still
working on the Click event.

I'm running CF 1.0 (SP 2) / -- Great help !! Thanks !!
 
P

Philip Gray

Sorry if this has already been covered, but does SP2 of the framework
support transparent backgrounds on labels?

I'd just like to build a for that has a pleasant user interface for a
change!
 

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