Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Button text ?

Status
Not open for further replies.

BuilderSpec

Programmer
Dec 24, 2003
383
GB
Does anyone know how to create a command button whose caption can wrap ? So I can split a longer caption over 2 lines ? MS Access does it no problem but I can't get Borland Builder to do it !

Anu ideas ?

Regards

BuilderSpec


 
You can use for it TBitBtn component. You must clear BitBtn caption, set BitBtn->Glyph->Canvas width and height to required size. Next draw on it using functions like TextOut or TextRect. By this you can make as much lines as you want. Other, easiest but not economic way is to write your text in paint and next load it to Glyph as bitmap. Good luck!!
 
Oh brother!!!

Unfortunately, there is a much easier way to do this, but I don't have the information with me a the moment. I'm using someone else's computer!
Use a standard button and use the DOS escape code /n for the wordwrap feature. (you may have to use it in code: such as)

char WW

WW = '/n';

Button1->Caption = "First part of line " + WW + "second part of line";


I'll get back to you as soon as I get the correct information

See you at Amanda Dearheart
 
Yes, you can use the \n new line character. This works on a TBitBtn, but not on a TButton.

BitBtn1->Caption = "Hello\nThere";

Will display a button

Hello
There


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top