Hi Guys,
back again with a stupid question.
Even though I googled it, I'm not getting a positive result.
I need tp pass the last Item of a ListBox (a number, not nessesarily an Integer) into a Variable or better into a Edit.Box or Label.
I managed to select last Item, but failed to pass it further. First item also would be an option. I only managed to pass the number of items..
Please look at my code here and correct it. Sorry for the inconveniance .....
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
procedure TForm1.Button1Click(Sender: TObject);
var iTest: Integer;
gesamt: Integer;
begin
ListBox1.Clear;
OpenDialog1.Filter:='txt-Dateien|*.txt';
if OpenDialog1.Execute then
ListBox1.Items.LoadFromFile(OpenDialog1.Filename);
for i:=ListBox1.Items.Count - 1 downto 0 do
if not TryStrToInt(ListBox1.Items, iTest) then
ListBox1.Items.Delete(i);
ListBox1.ItemIndex := ListBox1.Items.Count-1;
ListBox1.ClearSelection;
ListBox1.Selected[ListBox1.Count-1] := TRUE;
gesamt:= ListBox1.ItemIndex;
Edit1.Text := ListBox1.ItemIndex.ToString;
Label1.Caption := OpenDialog1.Filename;
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks
Klaus