I was thinking to create my own Menu in Mdiform, something like this:
End then I would create another Form which would open up when I click on the buttons to the left. However, I would like to open this form as maximized but without hiding menu buttons on the left from my MdiForm. Is this possible and if so, how can this be achieved?
Thank you for the input LarsTech...
Meanwhile, I have entered code to solve this:
FORM_MANAGE_PRODUCT formProduct = new FORM_MANAGE_PRODUCT();
formProduct.TopLevel = false;
formProduct.AutoScroll = true;
MAIN_PANEL.Controls.Add(formProduct);
formProduct.FormBorderStyle = FormBorderStyle.None;
formProduct.Show();
Related
I want to open a POP up on a context menu button click in C#.Please help.
And thanks in advance
You need to create a new Window class. You can design that then any way you want. You can create and show a window modally like this:
MyWindow popup = new MyWindow();
popup.ShowDialog();
You can add a custom property for your result value, or if you only have two possible results ( + possibly undeterminate, which would be null), you can set the window's DialogResult property before closing it and then check for it (it is the value returned by ShowDialog()).
I have a form that will display a number of gauges that the user can resize, move around close, etc. For this I use:
Form gaugeForm = new GaugeForm();
gaugeForm.TopLevel = false;
gaugeForm.Parent = this;
gaugeForm.Show();
The problem is that the gaugeForm has a thick, ugly, old-style border. If I open the same form without modifying parent/toplevel, it looks like all the other forms, but I want it to be inside the main form.
Any pointers? This is how it looks: Ugly form
Cheers,
Jostein
I'm supposed to create a small game menu in C#. What i'm doing now is that with each button you click in the main menu, you get a new form so it's something like this.
User clicks: Play
Form playMenu = new Form();
playMenu.Show();
this.Hide();
New form including buttons appears with new options to choose from.
I feel like there is a better way to do this but i have no idea how.
Something in a way of having just 1 form instead of multiple and having buttons something like this:
User clicks: Options
playButton.visible = false;
options.Visible = true;
Doing the above makes it possible to just have 1 form but wouldn't it be difficult to make changes to the buttons?
I have no idea if this is the right way to do this.
You have to design your sub-menus as UserControls instead of Forms, put them all in a single container (Panel) with Dock = DockStyle.Fill and toggle their Visible or z-order (with BringToFront and SendToBack methods).
This gives you much flexibility in terms of visual layout and data flow.
My apps use a timer that display a form after some seconds.
When I minimize my apps to do other stuff, the timer is still active (I'm ok with that) and the form bring to front over all my windows with focus on it (normal behavior).
I want that the new form open above my main apps but not above all my windows.
In the main form, I call the new form like this :
MRIS.EVENT_BOX form1 = new MRIS.EVENT_BOX();
form1.Owner = this;
form1.ShowDialog();
I manage to remove the focus problem by adding this in the EVENT_BOX :
protected override bool ShowWithoutActivation { get { return true; } }
I also check that TopMost is set to false in the new form.
But the new form is still show above all the others (without focus this time...).
I check some other questions but cannot manage to find something useful.
Some people talk about visible form ?
If you can help me ?
Thanks
You need to call form1.Show(); if you don't want to bring it to front
form1.Show();
//form1.BringToFront() You may need to call this if you want to being it to front
form1.ShowDialog() shows the form as dialog which means it will be shown on top of parent form. You can check more details on this here
I created a Form with menu strip. When I click on a menu item I want to open a new From in my main From.
It works but a part of the form is behind the menu like this :
my code :
WindowDossierProtection wdPr = new WindowDossierProtection();
wdPr.TopLevel = false;
this.Controls.Add(wdPr);
wdPr.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
wdPr.Dock = DockStyle.Fill;
wdPr.Show();
Can you help me ? thanks !!
Use BringToFront() to get your desired result:
WindowDossierProtection wdPr = new WindowDossierProtection();
wdPr.TopLevel = false;
this.Controls.Add(wdPr);
wdPr.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
wdPr.Dock = DockStyle.Fill;
wdPr.BringToFront();
wdPr.Show();
Do you use Visual Studio or something else?
This can be easily done by the Document Outline.
In Visual Studio go to :
View /
Other Windows /
Document Outline
Or use the shortcut:
Ctrl+W, U
Then, choose your form (in design view).
In the Document Outline window you will see all your controls and the order that exist in your form.
You simply have to drag your menuStrip in the end. (After your new form control)
And voila.
(I use VS2010)