Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# how to get text values from checklistbox?

Posted on 2004-08-23
Medium Priority
328 Views
I want to get text values from checklistbox...

procedure TForm1.CheckListBox1Click(Sender: TObject);
begin
end;
0
Question by:selas
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 27

Accepted Solution

kretzschmar earned 2000 total points
ID: 11868364
well, no delphi on hand yet, but i would guess

for i := 0 to checklistbox1.items.count-1 do
if checklistbox1.items[i].checked then
result := checklistbox1.items[i];

//be aware that multiple items could be checked

meikl ;-)
0

LVL 12

Expert Comment

ID: 11868505
procedure TForm1.Button1Click(Sender: TObject);
var
I:      Integer;
S:      string;
begin
S := '(';
for I := 0 to CheckListBox1.Items.Count-1 do
if CheckListBox1.Checked[I] then
S := S + CheckListBox1.Items[I] + ',';
if S<>'(' then
begin
Delete(S, Length(S), 1);
S := S + ')';
+ ' Select id, picture from people'
+ ' where now in '
+ S
+ '';
end;
end;
0

LVL 12

Expert Comment

ID: 11868529
procedure TForm1.Button1Click(Sender: TObject);
var
I:      Integer;
S:      string;
begin
S := '(';
for I := 0 to CheckListBox1.Items.Count-1 do
if CheckListBox1.Checked[I] then
S := S + CheckListBox1.Items[I] + ',';
if S<>'(' then
begin
Delete(S, Length(S), 1);
S := S + ')';
+ ' Select id, picture from people'
+ ' where now in '
+ S
+ '';
end;
end;
0

## Featured Post

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
###### Suggested Courses
Course of the Month9 days, 11 hours left to enroll