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,

PeterdeB
PeterdeBAsked:
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:)

PeterdeB
0
PeterdeBAuthor Commented:
procedure TForm3.LMDLabeledCheckListBox1Click(Sender: TObject);
var i,x: integer;
 begin
   for x:= 0 to lmdlabeledchecklistbox1.Items.Count -1 do
if lmdlabeledchecklistbox1.selected[x] then
 i:=x;
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 ;

end;

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

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

Peter
0
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.

jonas78Commented:
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
ie.

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


0
DragonSlayerCommented:
How about:

const
  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'
  );

and...

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

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
0
DragonSlayerCommented:
heh... you haven't emailed me for a while ;-)
0
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 emailaddress......so I'll provide mine

pdbiel@hotmail.com

Drop me a mail will ya?

My regards and max respect!!

PeterdeB from holland
0
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
Delphi

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.