改变程序标题栏的字体

时间:2010-02-03 12:46:28  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读: try    ACanvas.Handle := GetWindowDC(Form1.Handle);    with ACanvas do begin        Brush.Color := clActiveCaption;        Font.Name := 'Times New Roman';        Fo...
  正文:procedure WMNCPAint(var Mes : TWMNCPaint); message WM_NCPAINT;

procedure TForm1.WMNCPAint(var Mes : TWMNCPaint);
var
ACanvas : TCanvas;
begin
  ACanvas := TCanvas.Create;
  try
    ACanvas.Handle := GetWindowDC(Form1.Handle);
    with ACanvas do begin
        Brush.Color := clActiveCaption;
        Font.Name := 'Times New Roman';
        Font.Size := 10;
        Font.Color := clCaptionText;
        Font.Style := [fsItalic, fsBold];
        TextOut(GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CXBORDER),
        Round((GetSystemMetrics(SM_CYCAPTION) - Abs(Font.Height))/2) +1,
              ' Your title here!');
      end;
      finally
        ReleaseDC(Form1.Handle, ACanvas.Handle);
        ACanvas.Free;
      end;
    end;
"改变程序标题栏的字体"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Language/Delphi/12747.html


关键字:

关于《改变程序标题栏的字体》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td