Solved

Detect pop-up item

Posted on 2002-04-14
2
184 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 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Read about why website design really matters in today's demanding market.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
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:
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…

695 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