Board index » cppbuilder » How to show a PopupMenu?

How to show a PopupMenu?

Hello again...
Which is the right property of TPopupMenu to show a PopupMenu?

I placed this code in a function invoked by a OnClick event, but it doesn't
work...
MyForm->PopupMenu1;

I searched the net, but not many people seemed to have used this one.
What am I missing?

 

Re:How to show a PopupMenu?


Use the TPopupMenu::Popup function... in your case I guess it would look
something like this:

MyForm->PopupMenu1->Popup(Mouse->CursorPos.x, Mouse->CursorPos.y);

Cheers.

Re:How to show a PopupMenu?


Quote
"Ray Foster" <r...@fostersOnn.com> wrote in message

news:3d7e2f21@newsgroups.borland.com...

Quote
> Which is the right property of TPopupMenu to show a PopupMenu?

Just call it's Popup() method:

    PopupMenu1->Popup(X, Y);

Where X, and Y are the *screen* coordinates where you want the popup to
appear.

Quote
> I placed this code in a function invoked by a
> OnClick event, but it doesn't work...
> MyForm->PopupMenu1;

That only assigns the popup menu, that doesn't actually display it.

Gambit

Other Threads