Board index » cppbuilder » How to: Multiline button caption?

How to: Multiline button caption?

Hi ,

How can i give a button a caption which is larger then the size of the
button?
Can i split the desired caption so that it continous in the nextline?

example.
_________
|                |
|Hello wor |
|________|

change into:

_________
|    Hello    |
|    world   |
|________|

thanks

 

Re:How to: Multiline button caption?


Quote
"N. Karademir" wrote:

> Hi ,

> How can i give a button a caption which is larger then the size of the
> button?
> Can i split the desired caption so that it continous in the nextline?

> example.
> _________
> |                |
> |Hello wor |
> |________|

> change into:

> _________
> |    Hello    |
> |    world   |
> |________|

> thanks

Try this:
button->Caption = "Hello\nWorld";
David
--
"The man in black fled across the desert, and the gunslinger followed."
              Stephen King - The Gunslinger: Dark Tower I

Re:How to: Multiline button caption?


Hi N.Karademir

I found this on google

   long style = GetWindowLong(Button1->Handle, GWL_STYLE);
   style |= BS_MULTILINE;
   SetWindowLong(Button1->Handle, GWL_STYLE, style);

Place it in the forms constructor

Hope this helps

Gert

Re:How to: Multiline button caption?


Thanks i will try it

groetjes,

N. Karademir

"Gert Been" <gb...@customware.nl> schreef in bericht
news:3c15b297$1_2@dnews...

Quote
> Hi N.Karademir

> I found this on google

>    long style = GetWindowLong(Button1->Handle, GWL_STYLE);
>    style |= BS_MULTILINE;
>    SetWindowLong(Button1->Handle, GWL_STYLE, style);

> Place it in the forms constructor

> Hope this helps

> Gert

Re:How to: Multiline button caption?


On Mon, 10 Dec 2001 07:32:09 -0800, David Schumacher

Quote
<s...@gulfislands.com> wrote:
>"N. Karademir" wrote:

>> Hi ,

>> How can i give a button a caption which is larger then the size of the
>> button?
>> Can i split the desired caption so that it continous in the nextline?

>> example.
>> _________
>> |                |
>> |Hello wor |
>> |________|

>> change into:

>> _________
>> |    Hello    |
>> |    world   |
>> |________|

>> thanks

>Try this:
>button->Caption = "Hello\nWorld";
>David

It doesn't work stupid. Next time actually try something before
suggesting it to someone.
The worst thing about the internet are the "internet geniuses" who are
so dumb that they actually give out wrong advice.

Re:How to: Multiline button caption?


Please do not quote the whole of a message when replying. Most if not all of
us have the old message already.
Quote
> It doesn't work stupid. Next time actually try something before
> suggesting it to someone.
> The worst thing about the internet are the "internet geniuses" who are
> so dumb that they actually give out wrong advice.

Re:How to: Multiline button caption?


Does thid code also works when using a label ?

"Gert Been" <gb...@customware.nl> schreef in bericht
news:3c15b297$1_2@dnews...

Quote
> Hi N.Karademir

> I found this on google

>    long style = GetWindowLong(Button1->Handle, GWL_STYLE);
>    style |= BS_MULTILINE;
>    SetWindowLong(Button1->Handle, GWL_STYLE, style);

> Place it in the forms constructor

> Hope this helps

> Gert

Re:How to: Multiline button caption?


In a label you can set WordWrap to true in the ObjectInspector

Gert

Other Threads