![]() |
UiTypeEditorEditStyle.DropDown Beispiel gesucht.
Ich bastle eine eigene Komponente. Den modalen Designeditor nutze ich bereits für eine Eigenschaft. Doch die DropDownliste bekomme ich nicht hin. Kennt jemand das Problem? Kann jemand helfen? Hat jemand ein Beispiel (in Pascal)?
Hier mein bisheriges Ergebnis.
Delphi-Quellcode:
function AktivePageEditor.GetEditStyle( context: ITypeDescriptorContext): UITypeEditorEditStyle; begin if (Context <> nil) and (context.Instance <> nil) then Result := UiTypeEditorEditStyle.DropDown else Result := UiTypeEditorEditStyle.None; end; function AktivePageEditor.EditValue(context: ITypeDescriptorContext; provider: IServiceProvider; value: TObject): TObject; var Box1 : ListBox; begin if (context <> nil) AND (context.Instance <> nil) and (provider <> nil) then begin edsvc := (IWindowsFormsEditorService(provider.GetService(TypeOf(IWindowsFormsEditorService)))); if edsvc <> nil then begin Box1 := Listbox.Create; Box1.Items.Clear; Box1.Items.Add('Test'); Box1.Items.Add('Test1'); Box1.Items.Add('Test1'); Box1.Height := Box1.PreferredHeight; if (edSvc <> nil) then begin edSvc.DropDownControl( Box1 ); result := Box1.SelectedItem; end; end; end; // result := edsvc; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:40 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