Solved

How to showing SubMenu Using Button Press

Posted on 1998-07-02
3
255 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 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

20 Experts available now in Live!

Get 1:1 Help Now