Hi All!

I've found a great sample of clickable label (on
opennetcf.org forum). I have a question: is there a
possibility to add a word wrap to that label as in
default label control? How i can do that?

Thank You very much for any information
Very kind regards
Krzysztof Kazmierczak

Clickable label and word wrap - how? by siedevelopers

siedevelopers
Sun Dec 21 22:58:32 CST 2003

Yes u can,
Actually I've already used the word wraping technique in
one of my custom control. The Basic idea is as follows:

All u have to do is, to check the length of ur Text in
terms of width of label, if ur text doesn't gets into a
single line of ur label, then inscrease the height of the
label by the required number of lines. You have to
calculate the height of the label control before u perform
DrawRectangle() operation.
Generally a single line occupies 8 pixel of height. So to
get the height , multiply 8 with number of lines required
to fill the label.
Hope this soln works for u.

>-----Original Message-----
>Hi All!
>
>I've found a great sample of clickable label (on
>opennetcf.org forum). I have a question: is there a
>possibility to add a word wrap to that label as in
>default label control? How i can do that?
>
>Thank You very much for any information
>Very kind regards
>Krzysztof Kazmierczak
>
>.
>

Clickable label and word wrap - how? by Krzysztof

Krzysztof
Mon Dec 22 03:38:46 CST 2003

Hi!

Thanks for your help. Unfortunately, when i have text in
clickable label control which requires 2 lines and i set
height of the control to (for example) 400 pixels, i
still have text in 1 line. It doesn't wrap ;) I really
don't know why.

Kind regards!
Krzysztof Kazmierczak

>-----Original Message-----
>Yes u can,
>Actually I've already used the word wraping technique in
>one of my custom control. The Basic idea is as follows:
>
>All u have to do is, to check the length of ur Text in
>terms of width of label, if ur text doesn't gets into a
>single line of ur label, then inscrease the height of
the
>label by the required number of lines. You have to
>calculate the height of the label control before u
perform
>DrawRectangle() operation.
>Generally a single line occupies 8 pixel of height. So
to
>get the height , multiply 8 with number of lines
required
>to fill the label.
>Hope this soln works for u.
>


RE: Clickable label and word wrap - how? by katies

katies
Mon Dec 22 15:40:25 CST 2003

Hi,

Does your text contain whitespace? The word wrapping with labels is rather
weak, as it seems to depend on the text containing whitespace for the
wrapping algorithm (labels are based on the native static control).
Textboxes are a bit smarter - as they will workwrap without whitespace...I
would substitute your label for a read-only (possibly disabled) multiline
textbox if this is a problem for you.

Hope this helps,
-Katie

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

***.Net Compact Framework Info***
Faq:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
QuickStarts: http://samples.gotdotnet.com/quickstart/CompactFramework/
Samples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
tml/CompactfxTechArt.asp

--------------------
| Content-Class: urn:content-classes:message
| From: "Krzysztof Kazmierczak" <info@no_spamsmartsolutions.pl>
| Sender: "Krzysztof Kazmierczak" <info@no_spamsmartsolutions.pl>
| References: <029001c3c67f$3d6fa8e0$a401280a@phx.gbl>
<034d01c3c848$3f9cb160$a401280a@phx.gbl>
| Subject: Clickable label and word wrap - how?
| Date: Mon, 22 Dec 2003 01:38:46 -0800
| Lines: 32
| Message-ID: <050701c3c86f$659674b0$a501280a@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| thread-index: AcPIb2WUXHYMVZERTZWihHPE6C0EJQ==
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:41517
| NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi!
|
| Thanks for your help. Unfortunately, when i have text in
| clickable label control which requires 2 lines and i set
| height of the control to (for example) 400 pixels, i
| still have text in 1 line. It doesn't wrap ;) I really
| don't know why.
|
| Kind regards!
| Krzysztof Kazmierczak
|
| >-----Original Message-----
| >Yes u can,
| >Actually I've already used the word wraping technique in
| >one of my custom control. The Basic idea is as follows:
| >
| >All u have to do is, to check the length of ur Text in
| >terms of width of label, if ur text doesn't gets into a
| >single line of ur label, then inscrease the height of
| the
| >label by the required number of lines. You have to
| >calculate the height of the label control before u
| perform
| >DrawRectangle() operation.
| >Generally a single line occupies 8 pixel of height. So
| to
| >get the height , multiply 8 with number of lines
| required
| >to fill the label.
| >Hope this soln works for u.
| >
|
|