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 Move a menu bar outside the visible screen 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
26-Oct-02
Category
VCL-Forms
Language
Delphi 2.x
Views
134
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius

Is there a way of hiding a TMainMenu?

Answer:

Yes, do not hide it. What you do is leave it visible (as well as caption bar and 
border) and then just size the whole window so that only the client area is 
visible, all the nonclient area, including the menu bar, simply lies outside the 
visible screen. The alternative is to use a toolbar menu instead of a standard menu 
bar.

1   { ... }
2   private {in form declaration}
3   
4   procedure WMGetMinMaxInfo(var msg: TWMGetMinMaxInfo); message WM_GETMINMAXINFO;
5   { ... }
6   
7   procedure TForm1.WMGetMinMaxInfo(var msg: TWMGetMinMaxInfo);
8   begin
9     inherited;
10    with msg.MinMaxInfo^.ptMaxTrackSize do
11    begin
12      X := GetDeviceCaps(Canvas.handle, HORZRES) + (Width - ClientWidth);
13      Y := GetDeviceCaps(Canvas.handle, VERTRES) + (Height - ClientHeight);
14    end;
15  end;
16  
17  procedure TForm1.Button2Click(Sender: TObject);
18  const
19    Rect: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0);
20    FullScreen: Boolean = False;
21  begin
22    FullScreen := not FullScreen;
23    if FullScreen then
24    begin
25      Rect := BoundsRect;
26      SetBounds(Left - ClientOrigin.X, Top - ClientOrigin.Y,
27        GetDeviceCaps(Canvas.handle, HORZRES) + (Width - ClientWidth),
28        GetDeviceCaps(Canvas.handle, VERTRES) + (Height - ClientHeight));
29      { Label2.caption := IntToStr(GetDeviceCaps(Canvas.handle, VERTRES)); }
30    end
31    else
32      BoundsRect := Rect;
33  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