Solved

Detect pop-up item

Posted on 2002-04-14
2
181 Views
Last Modified: 2013-11-28
When click a standard button, I wish to detect what pop-up item is checked( selected ) and to go to OnSelect procedure of this item.
0
Comment
Question by:ginsonic
2 Comments
 
LVL 5

Accepted Solution

by:
alanwhincup earned 100 total points
ID: 6940338
this should work:

procedure TForm1.Button1Click(Sender: TObject);
var
  I : Integer;
begin
  with PopupMenu1 do
  begin
    for I := 0 to Items.Count - 1 do
    begin
      if Items[I].Checked then
        Items[I].OnClick(Sender);
    end;
  end;
end;

Cheers,

Alan
0
 

Expert Comment

by:djadja
ID: 6941700
As above but don't use the OnClick; if the popup item doesn't have the event assigned it will give you an Access Violation - instead use:

if Items[I].Checked then
       Items[I].Click;
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LAN or WAN ? 11 90
Convert a string into a TDateTime 5 60
online reputation management 1 47
Low-cost full color image t-shirt printing 5 78
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
Learn about the eCommerce marketing trends for the year ahead.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

776 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