Simulate windows behaviour > the checkbox'd listbox with description of each item > when cleaning your pc

Hi guys!

How can I copy the behaviour of the windows checkbox'd listbox so that when I select an item a description appears beneath it? Ten items should result in 10 different descriptions.

Working sample grants you the points!

My regards,

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PeterdeBAuthor Commented:
I'm almost there and will post the answer myself within an hour I hope:)

PeterdeBAuthor Commented:
procedure TForm3.LMDLabeledCheckListBox1Click(Sender: TObject);
var i,x: integer;
   for x:= 0 to lmdlabeledchecklistbox1.Items.Count -1 do
if lmdlabeledchecklistbox1.selected[x] then
case  i of
0:label1.caption := '';
1:label1.caption := '';
2:label1.caption := '';
3:label1.caption := '';
4:label1.caption := '';
5:label1.caption := '';
6:label1.caption := '';
7:label1.caption := '';
8:label1.caption := '';
9:label1.caption := '';
end ;


Working jiehaaaaaaaa!!! In case someone wanted to reply or is already doing so right now > you get the points anyway :)

PeterdeBAuthor Commented:
Oeps I'm a little too hasty > how can I get rid of the 'Variable i might not have been initialized' message?

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

I'm not sure on how to do that in a local procedure...
But if you declare the variables globaly you can set the value when you declare them

i : Integer = 0;
x : Integer = 0;

How about:

  MaxCount = 10;
  Descriptions: array [0 .. MaxCount - 1] of string = (
    'Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5',
    'Item 6', 'Item 7', 'Item 8', 'Item 9', 'Item 10'


procedure TForm3.LMDLabeledCheckListBox1Click(Sender: TObject);
  Label1.Caption := '';
  if (LMDLabeledCheckListBox1.ItemIndex <> -1) then
    if (LMDLabeledCheckListBox1.Selected[LMDLabeledCheckListBox1.ItemIndex]) then
      Label1.Caption := Descriptions[LMDLabeledCheckListBox1.ItemIndex];

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PeterdeBAuthor Commented:
Hey my friend Dragonslayer long time no see! Your solution works > I got rid of the annoying message. I haven't tested what Jonas posted because your solution seemed more of an answer than his no offence.

Thanks both of you for replying!!

My regards and max respect to you guys!!

PeterdeB from Holland
heh... you haven't emailed me for a while ;-)
PeterdeBAuthor Commented:
Correct my friend and you don't want to know how many times I got stuck in Delphi searching for answers you'd easily have given if I had asked. Which brings me to the following > I got rid of your I'll provide mine

Drop me a mail will ya?

My regards and max respect!!

PeterdeB from holland
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.