In the StringGrid control, the text content is made up and down in Cell.

zhaozj2021-02-11  226

In the StringGrid control, the text content is made up and down in Cell.

Seaspide 2001.4.19

After many practices, I finally found the way to solve the text content in each Cell unit:

It is the use of the dragon DRAW method to solve this problem by "painting". Ha, it's not the left road ~

Real is very simple:

Set a full sentence variable: var iScentre: boolean;

Use statements when you need to display text content up and down:

Cells [x, y]: = '', parallel ISCENTRE is true;

(Note: Be sure to assign a null value !! See the reason) ~~~~~ x, y is local variable

Add an onDrawcell event to the StringGrid control on Form1, process code:

Procedure TFORM1.STRINGGRID1DRAWCELL (Sender: Tobject; Acol, Arow: Integer;

Rect: TRECT; State: TGRIDDRAWState;

Begin

IF iscentre then

StringGrid1.canvas.textout (Rect.Left 14, Rect.top 8, 'Title Case ");

End; ~~~~~~~~~~~~~~~~~ /

Please adjust according to the specific settings!

Since this event is triggered, it is necessary to set a null value first to trigger StringGrid.

Ondrawcell event!

转载请注明原文地址:https://www.9cbs.com/read-3989.html

New Post(0)