I have a StringGrid which is able to draw new lines using an OnDraw method.
It works fine, but now I want that the user can enter a New Line using the keyboard. At the moment, multiline texts have to be copypasted into the StringGrid.
Everytime VK_RETURN is pressed, the StringGrid leaves the Edit mode. What do I have to do to avoid this?
For the new line, I want to have Ctrl+Return, like it is in Skype.
procedure TForm1.StringGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key = VK_RETURN) and (ssCtrl in Shift) then // Ctrl+Return = New Line
begin
// TODO: Do NOT cancel edit mode
// TODO: Insert #13#10 at current cursor position
end;
end;