• 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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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