Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Hiiding Main menu of MDI application

Posted on 2004-10-07
12
Medium Priority
?
181 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
  • 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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 describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

971 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