窗体半透明并且鼠标穿透效果
相关资料:
来自于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.
作者:疯狂Delphi
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
欢迎关注我,一起进步!扫描下方二维码即可加我