Solved

Hiiding Main menu of MDI application

Posted on 2004-10-07
12
179 Views
Last Modified: 2010-08-05
Hi experts

     I need to hide a main menu of my MDI application to achieve a full screen effect.
I can hide the task bar using folowing api

[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y,     int cx,     int cy,     uint uFlags );


But how can i achieve it for Main Menu.

Thanks n regards
Jatinder
0
Comment
Question by:jatinderalagh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
12 Comments
 
LVL 18

Expert Comment

by:armoghan
ID: 12256270
just do something like this
this.Menu = null;

and add the menu again it the code when its not full size mode
0
 
LVL 11

Author Comment

by:jatinderalagh
ID: 12256389
I tried this but it kills my application by effecting some other functionality.
That's why i am intrested in hiding menubar. rather then taking it out

Regards
Jatinder

0
 
LVL 18

Expert Comment

by:armoghan
ID: 12256478
I think this is the best way to do it, as it is part of your application.
I have tried it in number of applications and it never gives any problem.
You can make a simple application and see that it works fine.

Taskbar is not part of your application so you can use above mentioned code to do it.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 11

Author Comment

by:jatinderalagh
ID: 12256784
It is giving me a problem.
My application is made up of  customized classes.
That might be the reason.
cause when i add the menu again close button  of child window(currently opened) stop working.
Is there any other possible way to achieve this.
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12256958
close button may be referencing the MainMenu some how, you can check its references

>>>Is there any other possible way to achieve this.
Sorry.. I dont know any other way so far :(
0
 
LVL 11

Expert Comment

by:Agarici
ID: 12257339
try this:

private MainMenu mnu = null;
private void Tests_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if( mnu == null )
            {
                mnu = this.Menu;
                this.Menu = null;
            }
            else
            {  
                this.Menu = mnu;
                mnu = null;
            }
        }

(this is - as you can see - a KeyPress event handler for a form - a test form in my case )


hth,
A.
0
 
LVL 11

Author Comment

by:jatinderalagh
ID: 12258209
@Agarici

I don't want to use the approach of setting Menu to null;
This approach is already defined by armoghan.

I am intrested in knowing any alterante solution to this approach

Regards
Jatinder
0
 
LVL 11

Expert Comment

by:Agarici
ID: 12258423
i understood that and i saw that armorghan posted it first

what i was suggesting (and it is only a suggestion) is: instead of using YourForm.Menu in your app to provide " some other functionality" use a MainMenu var that will never be null. when you need to show the menu, assign that var to yourForm.Menu. when you need to hide the menu, set only YourForm.Menu to null


hth,
A.
0
 
LVL 11

Author Comment

by:jatinderalagh
ID: 12460519
Hi guys

For getting full screen effect and hiding  and docking menus
We need to use CommandBar from microsoft.Office.Core namespace using this we can achieve the same effect as VS.NET studio

Thanks n Regards
Jatinder
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 12509175
PAQd, 250 points refunded.

GhostMod
Community Support Moderator
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

627 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