?
Solved

Detect pop-up item

Posted on 2002-04-14
2
Medium Priority
?
185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
alanwhincup earned 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
An overview of how to create reports in Adobe Analytics (formerly Omniture Site Catalyst) using pageNames, events, eVars and props. This video will show you how to install the Omniture Debugger tool so can see (and test) what is being passed int…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Suggested Courses
Course of the Month15 days, left to enroll

771 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