So I have 2 ListBox-es on my form.
On the first one, I want to have 2 items: Maths and Languages. On the second, when user clicks Maths I want to show: Algebra and Geometry, and if user clicks on Languages to display Norwegian, Swedish etc.
How to do it?
Thanks for help.
Delphi TListBox Question
Started by nullbyte, Nov 09 2008 12:03 AM
2 replies to this topic
#1
Posted 09 November 2008 - 12:03 AM
|
|
|
#2
Posted 09 November 2008 - 04:35 PM
You will need an (I think) onclick event for the first listbox that clears the stringlist and uses the .add() method to add the new options to second listbox.
#3
Posted 10 December 2009 - 04:01 AM
ListBox2.Items.Clear;
case ListBox1.ItemIndex of
0:
begin
ListBox2.Items.Add('Algebra);
ListBox2.Items.Add('Geometry');
end;
1:
begin
ListBox2.Items.Add('Norwegian');
ListBox2.Items.Add('Swedish');
end;
end;
Edited by Jaan, 13 December 2009 - 12:22 PM.
Please use code tags when you are posting your codes!


Sign In
Create Account


Back to top









