user1580348
user1580348

Reputation: 6061

Partially transparent form without click-through?

In a Delphi 10.4.2 win-32 VCL Application in Windows 10, I use this form code to make the form partially transparent:

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

This has the effect of displaying a red frame with a transparent area inside the frame:

enter image description here

Unfortunately, the transparent area also has a CLICK-THROUGH "feature," which I do not want: The transparent area should only be transparent and clickable and NOT Click-Through, so when I click on the transparent area, I should get a click-event from the Panel.

So how can I deactivate the Click-through feature of the transparent area?

Upvotes: 0

Views: 402

Answers (0)

Related Questions