Re: TStringGrid and CR/LF
- From: alanglloyd@xxxxxxx
- Date: 18 Sep 2005 10:56:33 -0700
Bart wrote:
> Hi,
>
> I'm trying to load a table of strings (not a database, so I don't
> need/want data-aware components) into a TStringGrid. Some of the
> strings however contain CR/LF sequences and are not displaeyd in the
> stringgrid as I would like it to be.
> When I put the stringgrid in edit-mode, pressing the Enter-key also
> soed not give me a new line in the cell I'm in.
>
> Okay, so I want the individual cells of the stringgrid to behave as
> some sort of multiline-edit (no need for individual scrollbars per
> cell though <g>).
> Is this possible at all?
> If so, how can I achieve this.
>
> I'm using Delphi 3 Pro (for quite some time now, but this is the first
> time I'm using a StringGrid in any of my applications).
>
> Hope someone can help.
>
> Bart
> --
> Bart Broersma
> broersma.juda_ANTISPAM_@xxxxxxxxxx
> (ff _ANTISPAM_ wegpoetsen uit dit adres natuurlijk)
Firstly implement ownerdraw by coding to paint the display in the
OnDrawCell event handler. You can then use the DrawText() API to draw
multiline rows in the stringgrid within the cell rectangle.
Secondly when you double-click in the cell, create a TMemo instance and
position it over the cell which has been clicked on, and load it from
the cell. When the editing entry is finished the load the text back
from the TMemo to the TStringGrid and free the TMemo.
Alan Lloyd
.
- References:
- TStringGrid and CR/LF
- From: Bart
- TStringGrid and CR/LF
- Prev by Date: Re: Run Last
- Next by Date: Re: Run Last
- Previous by thread: TStringGrid and CR/LF
- Index(es):
Relevant Pages
|