Solved

How to copy a menu in IDE

Posted on 2002-03-03
3
184 Views
Last Modified: 2010-04-05
I have an old form that has a TPopupMenu on it.
I have created a new form to which I need to copy the TPopupMenu.

I selected the TPopupMenu on the old form, Pressed Ctrl-C clicked on the new form and pressed Ctrl-V. The TPopupMenu appeared in the new form - ok so far.

Now here's the problem:

No matter how I try to assign methods in the new form to the OnClick event of the TPopupMenu's menu items I cannot get the events to actually fire. I.e. the code in the methods attached to the events is never executed.

If I add a new menu item then I can configrre the OnClicked event for that new item no problem. If I delete an existing menu item and re-add it I can configure the OnClicked event no problem - I just cannot configure the OnClicked event for menuitems that were copied along with the TPopupMenu.

I have compared the .dfm files for both the new and old forms and I can't see any difference in the definitions for the TPopupMenu or the menu items.

What have I done wrong - should I be able to copy TPopupMenus in this manner?

Regards
Paul
0
Comment
Question by:zebada
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
shibin78 earned 100 total points
ID: 6838564
I have just tried as you said, it's all ok under my delphi 5.0 update pack 1. What is your delphi version ? If you can share your code is better.
0
 
LVL 6

Author Comment

by:zebada
ID: 6907927
I tried a few small example programs and like you say, they seem to work OK.

I guess it must be something wierd I am doing in my application. I will try to hunt it down and post a more detailed/accurate description of what/why it doesn't seem to work.

Regards
Paul
0
 
LVL 6

Author Comment

by:zebada
ID: 6924197
I can't reproduce the problem now.
You're right it seems to work fine.

Thanks for taking the time to reply :)
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

13 Experts available now in Live!

Get 1:1 Help Now