zoukankan      html  css  js  c++  java
  • Delphi中窗体的帮助按钮上执行一个自定义的动作

    先设置BorderStyle和BorderIcons

    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;
     

  • 相关阅读:
    Palindrome
    Girls' research
    最长回文
    Water Tree
    Alternating Current
    Psychos in a Line
    Feel Good
    Color the Fence
    javaScript内置类Date,Math等
    DOM之兄弟节点
  • 原文地址:https://www.cnblogs.com/martian6125/p/9631253.html
Copyright © 2011-2022 走看看