窗体半透明并且鼠标穿透效果

 

 

相关资料:

来自于QQ为“84365646”的方案。

 

实例:

 1 unit Unit1;
 2 
 3 interface
 4 
 5 uses
 6   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
 7   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
 8 
 9 type
10   TForm1 = class(TForm)
11     Button1: TButton;
12     Edit1: TEdit;
13     procedure Button1Click(Sender: TObject);
14   private
15     { Private declarations }
16 
17   public
18     { Public declarations }
19   end;
20 
21 var
22   Form1: TForm1;
23 
24 implementation
25 
26 {$R *.dfm}
27 
28 procedure TForm1.Button1Click(Sender: TObject);
29 begin
30   Self.AlphaBlend := true;
31   Self.AlphaBlendValue := 100;
32   Self.FormStyle :=fsStayOnTop;
33   SetWindowLong(Self.Handle, GWL_EXSTYLE, GetWindowLong(Self.Handle, GWL_EXSTYLE) or WS_EX_TRANSPARENT);
34 end;
35 
36 end.
View Code

 

posted on 2019-09-11 13:48  疯狂delphi  阅读(1076)  评论(0编辑  收藏  举报

导航