VS Designer Now Showing MainMenu - c#

I can't seem to fix this issue (which i hope is small) i have somehow when adding a ContextMenu did something to have the MainMenu bar not show up when i debug, if i click on the "MainMenu" in the designer (1st image) the menu bar shows up in the designer fine:
But if i click off it, then click on another control like:
The MainMenu disappears from the designer, when i build / debug the MainMenu is gone, is there a way to fix this easily enough (i assumed it would be as simple as checking a setting but googling did not return anything that i saw that was helpful)
Any help would be appreciated.

It looks like your MainMenu has ended up hidden behind your other controls. Try right clicking on the main menu and selecting Bring To Front. If you can't right click on it, right click on the control that's filling the rest of the form and select Send to back.
When you click on a menu control in the component tray it will always show it at the top of the screen (even if you click on a ContextMenu).
One other thing worth doing is to open the Document Outline window from the View->Other Windows menu in Visual Studio. This gives you a hierarchichal view of all the controls on the current form. You should be able to see your main menu here (unless you've somehow removed it from your form!)

Related

MainMenu disappears when adding ContextMenu every time

I have had this issue in Visual Studio ever since i started using it years ago, i cannot figure out what is going on, i add a MainMenu strip and fill it up with options, i then add a ContextMenu (if i need one in the particular application) when i do this, when i debug / build the MainMenu strip is gone, but the ContextMenu always shows.
I don't have any code as such but i have images to show how it looks in the designer:
Image 1 (When i click on the MainMenu control it shows in the designer)
Image 2 (When i click off the MainMenu control it disappears the same on debug / build)
I have looked over all the code i don't know what else to look at, any help would be appreciated.

In Visual Studio 2012 why is a message box in the project shown as the project loads?

In Visual Studio 2012, I added a message box to the load event of a WinForms user control that will pop up if the user control was not initialized correctly (when the load event is fired). All the check does is see if a couple of member variables in the user control are null or not.
The user control is in a different project from the main application because it will be used by more than one application.
The intended sequence of events is this:
In the main application, there is a right click menu with an option to show a window. That window contains the user control being referred to. When the user selects that menu item it creates an instance of the window, initializes the window through an initialization method, which in turn sets the variables in the user control to initialize it. Then the form.Activate method is called, then ShowDialog() and Focus() for the window containing the user control.
Here's the issue:
When I load the solution in Visual Studio 2012, while the solution is being loaded and before any code is shown, the message box is sometimes shown as a modal dialog of Visual Studio itself. The solution does not continue to load until I dismiss the message box.
Also, the message box is sometimes shown when I debug the application, popping up immediately after the login window of the application is shown. I can't seem to find any pattern to why the message box is shown in these two instances.
This is very mystifying as the code is not even executing, yet the message box is being shown. And during application start up the message box is shown even though the right click menu has not been selected.
To be honest I'm not even sure what information to give about this to get an answer. Any information pointing me in the right direction would be appreciated.
So that others like myself can see the answer to this question, Prix and Jonathon Reinhart have provided excellent answers in the comments to my question. But for completeness I'll just sum up.
The load event is fired as soon as the form or user control is ready. The user control is loaded on application start up so that it will be available to use in any form, which is what Prix is talking about. MSDN says this about the load event "Occurs before a form is displayed for the first time." Apparently this can mean even while starting your application, and not necessarily right before being shown.
In other words the load event is not the correct place to put an initialization check.
As for the message box being shown when the solution is loaded in Visual Studio, Jonathon Reinhart provided the key here. Apparently, the visual studio designer interface uses the load event to show the user control in the designer, so the code is executed as the designer loads your user control as well.
Mystification de-mystified. Thank you Prix and Jonathon. Such a simple answer, but I sure was stumped.

WPF : Storyboard - Add animation to move windows

Am creating WPF windows form application.
There are bout 7-8 usercontrols. Each user control has back and next button. When I click Next button, second form will appear and on Back previous form will appear. (You can image this with any installer)
Am able to show/hide forms. I want to add animation. As soon as I click Next button, control 1 must slide to left and control2 must come in from right (Imagine VS2012 setup)
I am using storyboard and able to slide controls but issue is control2 comes only after control1 disappear.
Please help me or provide code to achieve something like Visual Studio 2012 setup screens animation.
Am using this link (Page Transition Control) for reference.

System.Windows.Forms.MainMenu has a problem with merging elements

I have a menu in C# which is not a menu strip but instead a System.Windows.Forms.MainMenu, a professional menu in C#, but it has a problem.
This MainMenu is in parent window, and when we open child windows in parent by clicking on menu, an icon on the left side appears, and the number of icons appear. If number of menus are clicked and their child forms opened, that completely disturbs the menu. Secondly when child forms open, cross and minimize icons also get together.
You can find the image attached to understand clearly what I mean. The image attached is when I clicked on 4 menus and 4 child forms opened in a parent form. Remember I open the form without deleting the previous instance, because I don't want the child which is opened should be cleared when re-opened.
This is caused by a bug in Winforms. Do not create the MDI child window in the constructor, do it in a Load event handler you write.

Paint.NET style ToolWindow

Can anyone tell me how to make Paint.NET style ToolWindow(s)? Sorry I don't know if there is some kind of terminology to describe this better.
Currently my ToolWindows take focus whenever I click on a control inside of the ToolWindow or the ToolWindow itself. This means that if I click on the ToolBar or the MenuBar in the main form of my program that only bring the form into focus and doesn't actually click on the ToolBar / Menu. I don't want that.
You can donwload source code od Paint.NET and look how implemented "ToolWindows".
download page

Categories