This question already has answers here:
Can a form tell if there are any modal windows open?
(7 answers)
Closed 5 years ago.
Is there any way that we can detect if a child Dialog is opened ?
I tried googling there is not any good article
There should be a very simple solution to this.
Can anyone tell me how to do this ?
Is there any method or property in .Net Framework that I can call to get a boolean value somehow whether there is a Modal dialog is opened over my current window ?
so you want to check if the current Form owns any child modal Forms?
simply use the OwnedForms Property
this.OwnedForms.Any() //should return True if it owns any forms.
Related
This question already has an answer here:
Winforms Button Right-Click visual feedback (Show button in pushed state)
(1 answer)
Closed 5 years ago.
I'Ve got a winform application where specific Buttons should be visibly pressed whenever a specific key is pressed.
Capturing the key is not so much a Problem, but I did not find a method that allowed me to make it visible that a specific button as been "pressed".
(Even with button1.PerformClick() there was no visualization of the "click").
Is there any way to accomplish this?
You can use Control.Select() to activate the control.
This question already has answers here:
How to make modal dialog in WPF?
(4 answers)
Closed 6 years ago.
I'm developing an application and for the custom purposes of the app, I need a custom MessageBox.
I've created a new WPF Window and I'd like to force the user to interact with the custom message box before returning to the application, thus preventing them from using the application until a button inside the custom message box is pressed.
I've tried using .Focus() but it didn't work at all.
To give a perfect example of exactly what I want:
Try to press "Save As" in Outlook and then click on the "Mail" window again.
You instantly get "redirected" to the "Save As" Dialog and can't do anything on the main window until the dialog is closed.
Any ideas how to make this possible?
Basically, you want your new Window to be modal. The way to do it in WPF is to call the ShowDialog method rather than just Show
This question already has answers here:
How to make form system modal using C#?
(3 answers)
Closed 7 years ago.
Currently I have 2 forms open. However, I want one of both to be unresponsive while the other one is open.
It's not easy to describe, but I think all of you know that "plinging" sound when clicking on a main window while a prompt window of that form is open.
Is there a way to do this relatively quick?
I am pretty sure it would work with
Window.Enabled = false;
but I would prefer a way to perform it by setting an attribute only on the window I want the user to work on in that moment, instead of having to disable all others.
I could imagine something like
dialogwindow.Focus = true;
Is there a way to do this?
When you show your second window - you should show it with this method:
dialogWindow.ShowDialog();
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I add moving effects to my controls in C#?
I'm work on on a C# WinForms project, and I created a login form.
I want when I click in a link in this login form to make the controls in the login form to disappear sidely (like the effect in iPad when you move your finger on it) and other controls to be appeared .
Is there any chance to make this possible (using WinForm)?
Check DevExpress slider controls for Windows Forms.
You should find some examples here :
http://www.devexpress.com/Products/NET/Controls/WinForms/index.xml
http://www.devexpress.com/Products/NET/Controls/WinForms/Bars/toolbar_menu.xml (slide menu effecT)
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How can I prevent the user from resizing the silverlight out-of-browser window?
Is there any way to actually remove the ability to maximize/resize the out of browser window since I want my application to be of a certain size.
Thanks
I can't be 100% sure but I would hazard a guess you could just go:
this.resizable = false;
this.maximise = FALSE;
in the constructor of the views code behind file.
You can make any new window have no statusbar, no toolbar, no resize, etc. using window.open():
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
However, this is completely dependent on the browser, many ignore this, or have a user setting to override this behavior.