Board index » delphi » SelStart , SelEnd, SelLength

SelStart , SelEnd, SelLength


2003-07-08 04:24:53 PM
delphi258
Hello,
In a TDBEdit you can use the SelStart, SelEnd and SelLength functions. But
you can not use them in a TDBGrid, is there a possibility to simulate this
functions in a Grid. Or has the Grid his own funtions to do this ?????
kr
Bcl
 
 

Re:SelStart , SelEnd, SelLength

"Bert Clijsters" <XXXX@XXXXX.COM>writes:
Quote
In a TDBEdit you can use the SelStart, SelEnd and SelLength functions. But
you can not use them in a TDBGrid, is there a possibility to simulate this
functions in a Grid. Or has the Grid his own funtions to do this ?????
I don't understand the question. Do you want to know what cells,
columns, rows or ??? are selected? In the context of a single cell of
a TDBGrid, when that cell is in edit mode, there's usually an edit
control that holds the text being modified. Is that what you wanted?
Good luck.
Kurt
 

Re:SelStart , SelEnd, SelLength

I am talking about a single Cell of a TDBGrid. When the cell goes in edit
mode I want to know
which letters are selected, how long the selected text is , etc
kr
Bcl
"Kurt Barthelmess (TeamB)" <XXXX@XXXXX.COM>writes
Quote
"Bert Clijsters" <XXXX@XXXXX.COM>writes:

>In a TDBEdit you can use the SelStart, SelEnd and SelLength functions.
But
>you can not use them in a TDBGrid, is there a possibility to simulate this
>functions in a Grid. Or has the Grid his own funtions to do this ?????

I don't understand the question. Do you want to know what cells,
columns, rows or ??? are selected? In the context of a single cell of
a TDBGrid, when that cell is in edit mode, there's usually an edit
control that holds the text being modified. Is that what you wanted?

Good luck.

Kurt

 

Re:SelStart , SelEnd, SelLength

"Bert Clijsters" <XXXX@XXXXX.COM>writes:
Quote
I am talking about a single Cell of a TDBGrid. When the cell goes in edit
mode I want to know
which letters are selected, how long the selected text is , etc
There's a TInplaceEditor property of TCustomGrid that is used for the
actual editing, but you can not see that directly because it isn't
exposed in a TDBGrid. But it is easy to use a "cracker" class to get
around this:
type
TMyDBGrid = class(TCustomGrid)
end;
...
with TMyDBGrid(DBGrid1).InplaceEditor as TCustomEdit do
// access SelStart and SelLength here
Good luck.
Kurt
 

Re:SelStart , SelEnd, SelLength

Thank you very much for the advise, it realy helped me
kr
Bert
"Kurt Barthelmess (TeamB)" <XXXX@XXXXX.COM>writes
Quote
"Bert Clijsters" <XXXX@XXXXX.COM>writes:

>I am talking about a single Cell of a TDBGrid. When the cell goes in edit
>mode I want to know
>which letters are selected, how long the selected text is , etc

There's a TInplaceEditor property of TCustomGrid that is used for the
actual editing, but you can not see that directly because it isn't
exposed in a TDBGrid. But it is easy to use a "cracker" class to get
around this:

type
TMyDBGrid = class(TCustomGrid)
end;
...
with TMyDBGrid(DBGrid1).InplaceEditor as TCustomEdit do
// access SelStart and SelLength here

Good luck.

Kurt