• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Message popup over Listbox Item

Hey,

What code would I use so when I click a button a message popped up if there was a ITEM in the listbox called "Hello"?

Cheers,

Jeremy
0
computerprogramer
Asked:
computerprogramer
1 Solution
 
snehanshuCommented:
Is this what you are looking for?

procedure TForm1.Button1Click(Sender: TObject);
begin
  If ListBox1.Items.IndexOf('Hello') > -1 then
    ShowMessage('Found')
  else
    ShowMessage('Not Found');

end;

...Shu
0
 
EsopoCommented:
That, and MessageBox if you want to customize the dialog (set icon, set buttons, etc)
http://www.prestwood.com/community/delphi/info/displaythings/tsld004.htm
0
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now