Jul 19, 2006 #1 lespaul Programmer Feb 4, 2002 7,083 US If I have a list box that shows: 525: CV12345 526: DW12345 527: CR12345 and I want the user to double click on one of the items, how can I extract the first three characters (525 or 526)of the line that was double clicked? Thanks! Leslie
If I have a list box that shows: 525: CV12345 526: DW12345 527: CR12345 and I want the user to double click on one of the items, how can I extract the first three characters (525 or 526)of the line that was double clicked? Thanks! Leslie
Jul 19, 2006 1 #2 towerbase Programmer Jul 31, 2002 1,053 GB Something like this: Code: uses StrUtils; procedure TForm1.ListBox1DblClick(Sender: TObject); begin ShowMessage( LeftStr( ListBox1.Items[ListBox1.ItemIndex], 3 ) ); end; Andrew Hampshire, UK Upvote 0 Downvote
Something like this: Code: uses StrUtils; procedure TForm1.ListBox1DblClick(Sender: TObject); begin ShowMessage( LeftStr( ListBox1.Items[ListBox1.ItemIndex], 3 ) ); end; Andrew Hampshire, UK