![]() |
Re: Welche Windows Message beim Ändern der Eigenschaften Cap
versuch es mal mit CM_TEXTCHANGED
Delphi-Quellcode:
property Caption: TCaption read GetText write SetText stored IsCaptionStored;
procedure TControl.SetText(const Value: TCaption); begin if GetText <> Value then SetTextBuf(PChar(Value)); end; procedure TControl.SetTextBuf(Buffer: PChar); begin Perform(WM_SETTEXT, 0, Buffer); Perform(CM_TEXTCHANGED, 0, 0); end; ansonsten ein "Hack" dieses in eine Unit
Delphi-Quellcode:
und dann diese Unit überall, als Allerletztes in der Uses-Klausel einbinden, wo TLabel verwendet wird.
Unit LabelHack;
Interface Uses Classes, Controls, StdCtrls; Type TLabel = Class(StdCtrls.TLabel) Private FChange: TNotifyEvent; Function GetText: TCaption; Procedure SetText(Const Value: TCaption); Published Property OnChange: TNotifyEvent Read FChange Write FChange; Property Caption: TCaption Read GetText Write SetText; End; Implementation Function TLabel.GetText: TCaption; Begin Result := inherited Caption; End; Procedure TLabel.SetText(Const Value: TCaption); Begin If inherited Caption <> Value then Begin inherited Caption := Value; If Assigned(FChange) Then FChange(Self); End; End; End. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:45 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