Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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