Board index » cppbuilder » Re: CUT TEXT IN LABEL

Re: CUT TEXT IN LABEL


2004-06-01 12:42:14 AM
cppbuilder64
"N. Karademir" < XXXX@XXXXX.COM >wrote:
Quote
[...]
I live in netherlands

The first and last letters of Netherlands is not shown.

How can i break it in parts?
I presume that you're using a TLabel with the WordWrap and
AutoSize properties set to true. If so, when WordWrap is true,
the width of the label is fixed.
What you need to do is use the TLabel::Canvas::TextWidth method
to measure each word of the caption and set the label's width
(at a minimum) to the widest word.
~ JD
 
 

Re:Re: CUT TEXT IN LABEL

Hi,
if a word length is>10 characters then it must cut it in to pieces.
else it continous at the same line.
example
this text fits perfect:
This text fits
exactly in my
label
as you can see it is seperated into 3 lines.
if set the next text
I live in
netherlands
The first and last letters of Netherlands is not shown.
How can i break it in parts?
--
Smart Software
N. Karademir
 

Re:Re: CUT TEXT IN LABEL

i canot change the label width.
the size is fixed.
i use TStaticText
i don 't use TLabel because i need a label with borderline
tstatictext has no wordwrap.
"JD" < XXXX@XXXXX.COM >schreef in bericht
Quote

"N. Karademir" < XXXX@XXXXX.COM >wrote:
>[...]
>I live in netherlands
>
>The first and last letters of Netherlands is not shown.
>
>How can i break it in parts?

I presume that you're using a TLabel with the WordWrap and
AutoSize properties set to true. If so, when WordWrap is true,
the width of the label is fixed.

What you need to do is use the TLabel::Canvas::TextWidth method
to measure each word of the caption and set the label's width
(at a minimum) to the widest word.

~ JD

 

{smallsort}

Re:Re: CUT TEXT IN LABEL

Why not use TMemo?
It has a border and you can make et emulate a label by setting
ParentColor = true
ReadOnly = true
TabStop = false
/Palle