Solved

How to showing SubMenu Using Button Press

Posted on 1998-07-02
3
256 Views
Last Modified: 2010-04-04
20 (Very Hard ...)

How to showing SubMenu Using Button Press
(not using right button on mouse, but using TButton on Form)
0
Comment
Question by:hrizal
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
michaue earned 20 total points
ID: 1356976
Use the TPopupMenu.Popup event under the TButton.Click event remeber to give the X and Y parameters for the positions (see delphi help for further questions)

Also se the TPopupMenu.AutoPopup property to False

Elfrieda :)
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1356977
Do you mean really the submenu, or the popup menu?

The popup menu appears when clicking right mouse button, submenu always appears when moving with mouse pointer of menu item.

Anyway here is popup example (see delphi help files):

Popup, AutoPopup Example

This example uses a pop-up menu. When the user presses the mouse button, the pop-up menu appears where the user clicked the mouse:

procedure TForm1.FormCreate(Sender: TObject);
begin
  PopupMenu1.AutoPopup := False;
end;

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

begin
  PopupMenu1.Popup(X, Y);
end;

Zif.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1356978
hehe, seems that i was a little bit late...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

14 Experts available now in Live!

Get 1:1 Help Now