各位高手,我處理好了按回車鍵,光標就到下個控件的問題,但問題來了:等到Memo或RichEdit控件時,我想換行,光標卻是跑到下個控件去了,在這個控件上,我怎樣解除掉一按Enter就到下個控件的問題,代替它的是:要同時按下Enter與Shift兩鍵時才能到下個控件?
解决方案 »
- 小弟最近刚接触FastReport4,想做报表使用,可是报表界面的code页和event页打不开。
- Strings中如何設置每行固定長度
- tcombobox控件问题
- 自己做的一个长篇文字转GIF图片的dll组件,请高手帮忙解决一下图片高度问题
- 点个名,看看都谁在呀
- createcaret函数
- 如何在StatusBar上显示一个Progressbar?
- 将工具栏设为不可见,近日做DelPhi编程,麻烦一堆接一堆,好多问题,大家来帮帮忙吧!只能给100分!
- 100多个Client,在IdTCPServer的OnExecute中如何用TADOConnection连接SQL SERVER后保存数据?每个客户端Thread 构造一个TADOConnection吗?
- 请问大虾们从哪里可以下载到delphi 5的全部升级文件?
- 高分求超难SQL语句!
- 请问QuickReport怎样确定是否到了最后一页啊
这样应该好做点吧!
begin
showmessage('dasfasf') ;
end;
selectcontrol 记不清了,就是活动选择控件的那个
begin
if (ssshift in [ssshift]) and (key=#13) then
begin
showmessage('dasfasf') ;
end;end;
begin
//處理事件阿
end;
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
if (not (sender is TMemo)) and (not (sender is TRichEdit)) then
SendMessage(Form1.Handle,WM_NEXTDLGCTL,0,0)
end;2、同時下面這樣寫也不行:
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
if (Key=#13) then
SendMessage(Form1.Handle,WM_NEXTDLGCTL,0,0);
end;procedure TForm1.RichEdit1KeyPress(Sender: TObject; var Key: Char);
begin
if (ssshift in [ssshift]) and (Key=#13) then
SendMessage(Form1.Handle,WM_NEXTDLGCTL,0,0)
end;我要怎樣才可以啊?
不知道对你有没有帮助?
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key = 13) and not (ssCtrl in Shift) then
SendMessage(Self.Handle, WM_NEXTDLGCTL, 0, 0);
end;
就用这么一个试试看!