Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to detect if a menu as a whole is currently open or selected Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
23-Oct-02
Category
VCL-Menu
Language
Delphi All Versions
Views
125
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius

How to detect if a menu as a whole is currently open or selected

Answer:

1   { ... }
2   type
3     TForm1 = class(TForm)
4       MainMenu1: TMainMenu;
5       item01: TMenuItem;
6       item11: TMenuItem;
7       item21: TMenuItem;
8     private
9       { Private declarations }
10    public
11      procedure WMMENUSELECT(var M: TWMMENUSELECT); message WM_MENUSELECT;
12    end;
13    {...}
14  
15  procedure TForm1.WMMENUSELECT(var M: TWMMENUSELECT);
16  begin
17    inherited;
18  
19    {This beeps even if it is the sysmenu (control menu) and/or on any selected item: 
20  }
21    { messagebeep(MB_ICONASTERISK);  }
22  
23    { This beeps when MainMenu1 is opened, but only beeps on item[0]: }
24    if M.menu = Mainmenu1.handle then
25      messagebeep(MB_ICONASTERISK);
26  end;
27  
28  end.


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC