![]() |
Re: Listbox Items unselektierbar machen ohne Enabled propert
{Listbox1.Style := lbOwnerDrawFixed}
Delphi-Quellcode:
Falls du den Focus Rahmen noch wegbringen möchtest, wird's wohl komplizierter...
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState); begin with TListbox(Control) do begin if odSelected in State then begin Canvas.Brush.Color := Color; Canvas.Font.Color := Font.Color; end; Canvas.FillRect(Rect); Rect.Left := Rect.Left + 2; DrawText(Canvas.Handle, PChar(Items[Index]), -1, Rect, DT_SINGLELINE or DT_VCENTER); end; end; |
Re: Listbox Items unselektierbar machen ohne Enabled propert
@API
genau darum geht es. mfg Richard |
Re: Listbox Items unselektierbar machen ohne Enabled propert
oder so?
Delphi-Quellcode:
with (Control as TListBox) do
begin Canvas.Brush.Color := Color; Canvas.Font.Color := Font.Color; canvas.FillRect(rect); DrawText(Canvas.Handle, PChar(Items[Index]), -1, Rect, DT_SINGLELINE or DT_VCENTER); if odSelected in state then Canvas.DrawFocusRect(rect); end; |
Re: Listbox Items unselektierbar machen ohne Enabled propert
@API
Also das scheint meistens zu funktionieren, jedoch hatte ich beim Test hier 1 mal eine Doppelzeichnung des item selectframes. Trotzdem vielen Dank für deine Hilfe. mfG Richard |
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:28 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 by Thomas Breitkreuz