您现在的位置:首页 >> 界面报表 >> 界面报表 >> 内容

Delphi中窗体的帮助按钮上执行一个自定义的动作

时间:2011/9/3 15:24:11 点击:

  核心提示:先设置BorderStyle和BorderIcons 600) this.width = 600;'>type THelpForm = class(TForm) private procedure W...

先设置BorderStyle和BorderIcons

600) this.width = 600;">

type
   THelpForm = class(TForm)
   private
     procedure WMNCLBUTTONDOWN(var Msg: TWMNCLButtonDown) ; message WM_NCLBUTTONDOWN;
     procedure WMNCLBUTTONUP(var Msg: TWMNCLButtonUp) ; message WM_NCLBUTTONUP;
   end;

var
   HelpForm: THelpForm;

implementation
{$R *.dfm}

procedure THelpForm.WMNCLBUTTONDOWN(var Msg: TWMNCLButtonDown) ;
begin
   if Msg.HitTest = HTHELP then
     Msg.Result := 0 // "eat" the message
   else
     inherited;
end;

procedure THelpForm.WMNCLBUTTONUP(var Msg: TWMNCLButtonUp) ;
begin
   if Msg.HitTest = HTHELP then
   begin
     Msg.Result := 0;
     ShowMessage('Need help?') ;
   end
   else
     inherited;
end;

作者:站长 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号