DELPHI的窗体不好看,我想通过图片将窗体的标题栏改掉,如何处理啊,最好给一些例子呵

解决方案 »

  1.   

    这个很麻烦了实现起来很花时间的,不过有这方面的控件下,
    Delphibox里头有的你下一个就可以了
      

  2.   

    重画标题栏
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type
      TForm1 = class(TForm)
        Label1: TLabel;
      private
        { Private declarations }
        procedure WMNCPAint(var Mes : TWMNCPaint); message WM_NCPAINT;
        procedure WMNCACTIVE(var msg: TMessage); message WM_NCACTIVATE;procedure Paint_Caption;  public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}
    var
      State:Integer;procedure TForm1.WMNCPAint(var Mes : TWMNCPaint);
    begin
      inherited;
      Paint_Caption;
    end;procedure TForm1.Paint_Caption;
    var
      ACanvas : TCanvas;
    begin  ACanvas := TCanvas.Create;
      try
        ACanvas.Handle := GetWindowDC(Form1.Handle);
        with ACanvas do begin
          if State=1 then
            Brush.Color :=  clActiveCaption
          else
            Brush.Color :=  clInactiveCaption;      Font.Name := 'Times New Roman';
          Font.Size := 12;
          Font.Color := clYellow;
          Font.Style := [fsBold];      TextOut(GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CXBORDER),
                  Round((GetSystemMetrics(SM_CYCAPTION) - Abs(Font.Height))/2) +1,
                  '千堆雪最近不常来了');
    ////////////////////////////////////////////////////////////////////////////////
        end;
      finally
        ReleaseDC(Form1.Handle, ACanvas.Handle);
        ACanvas.Free;
      end;
    end;procedure TForm1.WMNCACTIVE(var msg: TMessage);
    begin
      inherited;
      State:=msg.WParam;
      Paint_Caption;
    end;end.