可以用截获窗口消息来得知道窗口失去焦点了。
procedure WndProc(var Msg: TMessage);override;
procedure TForm1.WndProc(var Msg: TMessage);
begin
if (Msg.Msg=WM_KILLFOCUS) then
begin
showmessage('失去焦点!'+inttostr(i));
inherited;
end;end;但如何当失去焦点时,使窗口获得焦点。请大家帮忙,我经理又在叫呢,
不行呀,最近问题很多呀,看来奖金又要没有了。晕
procedure WndProc(var Msg: TMessage);override;
procedure TForm1.WndProc(var Msg: TMessage);
begin
if (Msg.Msg=WM_KILLFOCUS) then
begin
showmessage('失去焦点!'+inttostr(i));
inherited;
end;end;但如何当失去焦点时,使窗口获得焦点。请大家帮忙,我经理又在叫呢,
不行呀,最近问题很多呀,看来奖金又要没有了。晕
解决方案 »
- Oracle - ODBC 安装
- 熟悉LISTBOX控件的前辈帮个忙。。
- 请问如何在成功安装service application应用程序后不显示"service installed successfully"提示
- 帮我看看这段代码怎么写才对!
- 请问这是什么意思?
- RichEdit的简单问题!在线等待!
- 如何将汇编语言加载到delphi中
- 请教:姓名 = '张%'、姓名 = '%张%' 查询没有问题,但是姓名= '%张'就出错?!
- 顶者得分 ------- 参加广州广交会总共多少钱?包括展位,宾馆酒店预定等。
- 关于提取注册表一个键值并显示的问题。
- 求的delphi中指针方面的资料,谢谢帮助!
- 1stclass 4000 求助 在线等... ...
procedure TForm1.WndProc(var Msg: TMessage);
begin
if (Msg.Msg=WM_KILLFOCUS) then
begin
showmessage('失去焦点!'+inttostr(i));
SysFocus(Form1.Handle); //我加了让本窗口获取焦点
inherited;
end;end;会报错,整个程序都不能运行了。
提示系统找不到某个运行库,也没有说什么运行库。
不知道我这样做会不会对。
procedure TForm1.WndProc(var Msg: TMessage);
begin
if (Msg.Msg=WM_KILLFOCUS) then
begin
showmessage('失去焦点!'+inttostr(i));
inherited;
end
else inherited;end;这样才不会错。
begin
if(Msg.Msg=WM_KILLFOCUS) then Application.BringToFront;
inherited;
end;