文字列プロパティを にバインドする際に問題がありますTLabel
。
TGotManager = class(TComponent)
..
..
published
property HotQ1: String read FHotQ1 write SetHotQ1;
property HotQ2: string read FHotQ2 write SetHotQ2;
..
TPrototypeDatasource を使用したくないので、コンポーネントを作成しました。
私の目標はTLabel.text
、デザイナーを介して両方のプロパティをバインドすることです。
ここでの回答の助けを借りてこれを行いました: Delphi: Making a component visible to live binding
例 1:
//with this only HotQ1 is bindable via the designer.
[ObservableMember('HotQ1')]
TGotManager = class(TComponent)
例 2:
//with this only HotQ2 is bindable via the designer.
[ObservableMember('HotQ1')]
[ObservableMember('HotQ2')]
TGotManager = class(TComponent)
問題は、デザイナーを介して 1 つのプロパティしかバインドできないことです。そのプロパティをドラッグすると、互換性のある他のプロパティが緑色に点灯します。2 番目のプロパティをドラッグすると、他のプロパティは赤のままになります。