![]() |
Bei Return und ListBox Cursor ist oben
Bei Return springt der Cursor immer nach oben.
Wenn die ListBox auf Style := lbVirtual; eingestellt wurde. Warum und wie kann man das ändern.
Code:
MFG
unit Unit1;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, AcroPDFLib_TLB, OleCtrls; type TForm1 = class(TForm) Panel1: TPanel; ListBox1: TListBox; procedure FormCreate(Sender: TObject); procedure ListBox1Data(Control: TWinControl; Index: Integer; var Data: String); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin with ListBox1 do begin Style := lbVirtual; Count := 100; Width := 300; Align := alLeft; end; end; var X : Integer = 1; procedure TForm1.ListBox1Data(Control: TWinControl; Index: Integer;var Data: String); begin Data :='Man bin ich ein Teil zum...'+intToStr(X); inc(X); end; end. |
Re: Bei Return und ListBox Cursor ist oben
vielleicht so?
Delphi-Quellcode:
Was hast du vor?
procedure TForm1.ListBox1KeyPress(Sender: TObject; var Key: Char);
begin Key := char(0); end; |
Re: Bei Return und ListBox Cursor ist oben
Ja geht und ich habe schon an die SendMassages auseinandergenommen.
Ich finde das ist ein SCH... Bug, denn der normalen Variante Tritt das nicht auf. Ich Arbeit fast ausschließlich mit virtuellen Methoden, Weil die einfach VIEL schneller sind und der Aufwand ist nicht wirklich groß. Ab 100 Einträge wir das mit Add() zu einem „Ich gehe mal Kaffe koche“ und mit virtuellen Methoden, bin ich im ms Bereich. Danke! :mrgreen: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:55 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