AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Notification, falls Komponente nicht mehr sichtbar

Ein Thema von hellion · begonnen am 16. Okt 2018 · letzter Beitrag vom 16. Okt 2018
 
ghubi01

Registriert seit: 18. Nov 2017
136 Beiträge
 
Delphi 12 Athens
 
#7

AW: Notification, falls Komponente nicht mehr sichtbar

  Alt 16. Okt 2018, 20:59
Hallo hellion,

hier hätte ich noch eine Idee:
Delphi-Quellcode:
const
  MY_MSG = WM_USER + 1;

type
  TCheckBox = class(Vcl.StdCtrls.TCheckBox)
  private
    FParantVisible: Boolean;
  protected
    procedure ParentMsg(var Msg: TMessage); Message MY_MSG;
  public
    property ParantVisible: Boolean read FParantVisible;
  end;

  TComboBox = class(Vcl.StdCtrls.TComboBox)
  private
    FParantVisible: Boolean;
  protected
    procedure ParentMsg(var Msg: TMessage); Message MY_MSG;
  public
    property ParantVisible: Boolean read FParantVisible;
  end;

  ...

procedure TCheckBox.ParentMsg(var Msg: TMessage);
begin
  FParantVisible:=Boolean(Msg.WParam);
end;

procedure TComboBox.ParentMsg(var Msg: TMessage);
begin
  FParantVisible:=Boolean(Msg.WParam);
end;

  ...

procedure TForm2.TestClick(Sender: TObject);
var
  MyMsg: TMessage;
begin
  //Nach jedem Visible-Wechsel eine Botschaft an Alle senden
  GroupBox1.Visible:=not GroupBox1.Visible;
  MyMsg.Msg:=MY_MSG;
  MyMsg.WParam:=integer(GroupBox1.Visible);
  MyMsg.LParam:=0;
  MyMsg.Result:=0;

  GroupBox1.Broadcast(MyMsg); // Die Message geht an alle Controls der GroupBox1
end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:57 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz