Page 1 of 1

DcPushbutton Wordbreak

Posted: Mon Dec 21, 2020 3:06 am
by jdsoft
I try to get WordBreak in DCPUSHBUTTON.
Already tryed:

Code: Select all

LOCAL cBtnLabel := "First;Second" 
@ 1, 1  DCPUSHBUTTON CAPTION cBtnLabel   SIZE 15,5
and

Code: Select all

LOCAL cBtnLabel := "First" + Chr(10 + Chr(13) + "Second" 
@ 1, 1  DCPUSHBUTTON CAPTION cBtnLabel   SIZE 15,5
and

Code: Select all

LOCAL cBtnLabel := "First Second" 
LOCAL aBtnPres := {{XBP_PP_ALIGNMENT,XBPALIGN_WORDBREAK}}
@ 1, 1  DCPUSHBUTTON CAPTION cBtnLabel   SIZE 15,5 PRESENTATION aBtnPres
No success until now.
What is my mistake?

Re: DcPushbutton Wordbreak

Posted: Mon Dec 21, 2020 3:43 am
by Tom
Did this ever work with standard buttons? I remember I changed buttons to DCPUSHBUTTONXP (ownerdrawing) to get this going, and then I removed it, since two-line-buttons don't look good.

Re: DcPushbutton Wordbreak

Posted: Mon Dec 21, 2020 5:08 am
by Piotr D
Hi,
@1,2 DCPUSHBUTTON CAPTION 'First Second' ALIGNCAPTION BS_MULTILINE

Regards
Piotr

Re: DcPushbutton Wordbreak

Posted: Mon Dec 21, 2020 5:16 am
by Piotr D
Or
@1,2 DCPUSHBUTTON CAPTION 'First;Second' ALIGNCAPTION BS_MULTILINE

Piotr

Re: DcPushbutton Wordbreak

Posted: Mon Dec 21, 2020 5:21 am
by Tom

Code: Select all

@1,2 DCPUSHBUTTON CAPTION 'First;Second' SIZE 10,2 ALIGNCAPTION BS_MULTILINE
You forgot the semicolon, which is needed to get this working. And it works.

Re: DcPushbutton Wordbreak

Posted: Mon Dec 21, 2020 5:51 am
by Piotr D
Tom,
Without a semicolon, the text will break automatically when the button size is reached.

Regards
Piotr

Re: DcPushbutton Wordbreak

Posted: Mon Dec 21, 2020 7:40 am
by rdonnay
@1,2 DCPUSHBUTTON CAPTION 'First;Second' SIZE 10,2 ALIGNCAPTION BS_MULTILINE
I don't think I ever used that feature and may not have been aware of that.
Yes, it does work very well.

Re: DcPushbutton Wordbreak

Posted: Mon Dec 21, 2020 8:48 am
by jdsoft
Hello,

Thank you !
I was not aware of the ALIGNCAPTION BS_MULTILINE.
This does exactly what i need.