在RichEdit控件中使用ctrl+enter快捷键的问题
我想在RichEdit控件中使用ctrl+enter快捷键,但当按下组合键ctrl+enter时,
回车键起作用了,每按一次组合键,就会插入一个换行.按组合键的时候,也不会
出发OnKeyPress事件,不能通过key:=#0来屏蔽回车键.要怎么做才能实现在按
组合键ctrl+enter时,richedit不接受enter键产生的换行?
procedure TForm1.RichEdit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (key=vk_return) and (ssCtrl in shift) then
begin
showmessage('KeyDown');
end;
end;
procedure TForm1.RichEdit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
showmessage('KeyPress');
end;
end;