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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating line breaks in TStringGrid Cells - Possible?

Status
Not open for further replies.

CHeighlund

Programmer
Jun 11, 2007
163
0
0
US
I'm working with a TStringGrid component, and I've been requested to break some of the text in a specific group of the boxes, as below:

Before:
Code:
Total - Flurbs

After:
Code:
Total
Flurbs

I know that the chr(13) command can break some strings, as I've used that before in MessageDlg commands, but in the TStringGrid I'm working with, doing this simply leaves a black line visible on the screen. The text (actually html) output the program generates does have the break in the correct spot, however.

Is there some way to get the break to appear on the screen, and if so, what would be a good place to start looking for it?
 
Have you looked at disabling DefaultDrawing and handling the OnDrawCell event in your TStringGrid component?

You can do most things if you handle the OnDrawCell event yourself including writing two lines of text in a cell.

It is also possible to implement combo boxes and so on in a TStringGrid component if you handle the drawing.



Andrew
Hampshire, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top