Link to home
Start Free TrialLog in
Avatar of LeTay
LeTay

asked on

Simulate the <Enter> key in editable TStringGrid cell

I have a TStringGrid with editable cells (set the options correctly).
Now I want this to happen : when the user encode the = sign in a cell, the <Enter> key should be simulated.
So the user does not have to hit the <Enter> key in that situation
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LeTay
LeTay

ASKER

Hum, I want this : when the user press the = (equal sign), that value should go into the cell and key presss <Enter> should be done by the application (instead of by the user)
Second proposal does not work, = is not referenced anywhere
Can you make small test project with same grid Options. Are you in edit mode when pressing SHIFT+0 (aka '=')?
What happens when you press ENTER? (or want to)
It exit edit mode in my case.
Avatar of LeTay

ASKER

Hello, on my keyboard, AZERT Belgium, the = sign is NOT shift-0 !
That's the difference
The = sign is just ... the equal sign without shift
so, if you put his code:

procedure TForm7.StringGrid1KeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
   ShowMessage(IntToStr(Key));
end;

Open in new window


what is showed on message in case when press '='?
Avatar of LeTay

ASKER

Found 187
Used now
Works
yes, VK_OEM_PLUS when look in this table....