在 Windows 10 中的 Delphi 10.4.2 win-32 VCL 应用程序中,我使用此表单代码使表单部分透明:
object Form1: TForm1
Left = 0
Top = 0
BorderStyle = bsNone
Caption = 'Form1'
ClientHeight = 378
ClientWidth = 589
Color = clRed
TransparentColor = True
TransparentColorValue = clGreen
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
FormStyle = fsStayOnTop
OldCreateOrder = False
Position = poDefault
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
AlignWithMargins = True
Left = 3
Top = 3
Width = 583
Height = 372
Align = alClient
BevelOuter = bvNone
Color = clGreen
ParentBackground = False
TabOrder = 0
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 589
ExplicitHeight = 378
end
end
这具有在框架内显示具有透明区域的红色框架的效果:
不幸的是,透明区域也有一个 CLICK-THROUGH “功能”,这是我不想要的:透明区域应该只透明且可点击而不是点击,所以当我点击透明区域时,我应该点击- 来自小组的事件。
那么如何禁用透明区域的点击功能呢?