unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;
type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    GroupBox1: TGroupBox;
    procedure FormCreate(Sender: TObject);
    procedure createparams(var params: Tcreateparams); override; //重载FORMCREATE,!!!
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;
implementation
{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
  form1.Brush.Style := bsclear;
  form1.borderstyle := bsnone;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
  close;
end;procedure TForm1.createparams(var params: Tcreateparams);
begin
  inherited createparams(params); //!!!
  params.exstyle := WS_EX_TRANSPARENT; //!!!
end;end.

解决方案 »

  1.   

    将一个FORM变成透明的实质性手段就是拦截CMEraseBkgnd消息。unit Utransform; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm)private { Private declarations }public { Public declarations }PROCEDURE CMEraseBkgnd(var Message:TWMEraseBkgnd);Message WM_ERASEBKGND;end;var Form1: TForm1;implementation{$R *.DFM}PROCEDURE Tform1.CMEraseBkgnd(var Message:TWMEraseBkgnd);BEGINbrush.style:=bsClear;Inherited;END;end.procedure TForm1.FormCreate(Sender: TObject);
    begin
      Form1.Brush.Style := bsClear;
      Form1.BorderStyle := bsNone
    end;procedure TForm1.BitBtn1Click(Sender: TObject);
    begin
      Application.Terminate;
    end;
      

  2.   

    不懂你的意思,你要怎么样才透明,
    我在一本书上看到过例子,叫什么 Delphi编程一百例 吧,广州购书中心有,去看看就知道了,也不用花钱买,因为很简单!一下子就可以吧它记下来!
      

  3.   

    unit Win2k;interfaceuses
      Windows;const
      WS_EX_LAYERED = $00080000;
      LWA_ALPHA = $00000002;type
      FAnimateWindow = function(const hwnd: HWND; const dwTime: DWORD; const dwFlags: DWORD):DWORD; stdcall;
      FSetLayeredWindowAttributes = function(hWnd: HWND; crKey: DWORD; bAlpha: Byte; dwFlags: DWORD): BOOL; stdcall;function AnimateWindow(const hwnd: HWND; const dwTime: DWORD; const dwFlags: DWORD):DWORD;
    function SetLayeredWindowAttributes(hwnd: HWND; crKey: DWORD; bAlpha: Byte; dwFlags: DWord): BOOL;implementationfunction AnimateWindow(const hwnd: HWND; const dwTime: DWORD; const dwFlags: DWORD):DWORD;
    var
      DLLHandle : THandle;
      AnimateWindow : FAnimateWindow;
    begin
      Result := 0;
      DLLHandle := LoadLibrary('user32.dll');
      if DLLHandle <> 0 then begin
        @AnimateWindow := GetProcAddress(DLLHandle,'AnimateWindow');
        if @AnimateWindow <> nil then begin
          Result := AnimateWindow(hwnd,dwTime,dwFlags);
        end;
      end;
    end;function SetLayeredWindowAttributes(hwnd: HWND; crKey: DWORD; bAlpha: Byte; dwFlags: DWORD): BOOL;
    var
      DLLHandle : THandle;
      gwlStyle : Longint;
      SetLayeredWindowAttributes : FSetLayeredWindowAttributes;
    begin
      Result := false;
      DLLHandle := LoadLibrary('user32.dll');
      if DLLHandle <> 0 then begin
        @SetLayeredWindowAttributes := GetProcAddress(DLLHandle,'SetLayeredWindowAttributes');
        if @SetLayeredWindowAttributes <> nil then begin
          gwlStyle := GetWindowLong(hwnd,GWL_EXSTYLE);
          gwlStyle := gwlStyle or WS_EX_LAYERED;
          SetWindowLong(hwnd,GWL_EXSTYLE,gwlStyle);
          Result := SetLayeredWindowAttributes(hWnd,crKey,bAlpha,dwFlags);
        end;
      end;
    end;end.
    调用方法, 可以调透明度(0-255)的, 但要在WIN2000下方可以
    begin
      SetLayeredWindowAttributes(Handle,0,透明度值,LWA_ALPHA);
    end;
      

  4.   

    不懂你的意思,你要怎么样才透明,
    我在一本书上看到过例子,叫什么 Delphi编程一百例 吧,广州购书中心有,去看看就知道了,也不用花钱买,因为很简单!一下子就可以吧它记下来!