Solved

Message popup over Listbox Item

Posted on 2004-09-09
2
153 Views
Last Modified: 2011-09-20
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
Comment
Question by:computerprogramer
2 Comments
 
LVL 5

Accepted Solution

by:
snehanshu earned 30 total points
Comment Utility
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
 
LVL 14

Expert Comment

by:Esopo
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now