Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2004-11-12
8
Medium Priority
?
141 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:PeterdeB
  • 5
  • 2
8 Comments
 

Author Comment

by:PeterdeB
ID: 12565439
I'm almost there and will post the answer myself within an hour I hope:)

PeterdeB
0
 

Author Comment

by:PeterdeB
ID: 12566360
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
 

Author Comment

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

Peter
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Expert Comment

by:jonas78
ID: 12567193
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
 
LVL 14

Accepted Solution

by:
DragonSlayer earned 500 total points
ID: 12568444
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
 

Author Comment

by:PeterdeB
ID: 12574573
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
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 12574960
heh... you haven't emailed me for a while ;-)
0
 

Author Comment

by:PeterdeB
ID: 12576354
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question