Solved

Hiiding Main menu of MDI application

Posted on 2004-10-07
12
178 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using sqldatareader to populate cells in Excel-syntax 6 35
Create a Dropdown list with sub group 10 43
array not updating 8 42
Send parameters via datatable ajax call 4 43
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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