zoukankan      html  css  js  c++  java
  • Delphi中在窗体标题栏画自定义文字

    type
       TCustomCaptionForm = class(TForm)
       private
         procedure WMNCPaint(var Msg: TWMNCPaint) ; message WM_NCPAINT;
         procedure WMNCACTIVATE(var Msg: TWMNCActivate) ; message WM_NCACTIVATE;
         procedure DrawCaptionText() ;
       end;

    ...

    implementation


    procedure TCustomCaptionForm .DrawCaptionText;
    const
       captionText = 'delphi.about.com';
    var
       canvas: TCanvas;
    begin
       canvas := TCanvas.Create;
       try
         canvas.Handle := GetWindowDC(Self.Handle) ;
         with canvas do
         begin
           Brush.Style := bsClear;
           Font.Color := clMaroon;
           TextOut(Self.Width - 110, 6, captionText) ;
         end;
       finally
         ReleaseDC(Self.Handle, canvas.Handle) ;
         canvas.Free;
       end;
    end;

    procedure TCustomCaptionForm.WMNCACTIVATE(var Msg: TWMNCActivate) ;
    begin
       inherited;
       DrawCaptionText;
    end;

    procedure TCustomCaptionForm.WMNCPaint(var Msg: TWMNCPaint) ;
    begin
       inherited;
       DrawCaptionText;
    end;
     

  • 相关阅读:
    elasticSearch 查询 bool
    elasticSearch 查询 term
    elasticSearch 查询 match
    python re
    vue day1
    mysql 报错记录
    node.js vue.js 安装
    mysql 插入数据 ,存在跳过
    打印乘法口诀表
    初步使用分支、循环判断数字大小
  • 原文地址:https://www.cnblogs.com/martian6125/p/9631252.html
Copyright © 2011-2022 走看看