How can I make a form "unresponsive"? [duplicate] - c#

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();

Related

How to detect if there is a child dialog opened C#? [duplicate]

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.

Is it possible to programmatically make an optical click? [duplicate]

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.

Getting precise focused element in c# [duplicate]

This question already has answers here:
How do I find out which control has focus in .NET Windows Forms?
(7 answers)
Closed 6 years ago.
I'm having trouble figuring out how to get c# to get the focused element within a window. I've a window of another program with two text boxes, a dropdown, and two buttons. I need to be able to open this program, pull it to the front, and fill in the two text boxes and select from the dropdown programatically.
I can pull the window forward with SetForegroundWindow and fill things out and navigate about with SendKeys, but since I don't always know which box the cursor will start in, I need to be able to determine where it is once I've pulled it to the front to fill them in properly.
Any ideas?
Going off of memory and pseudocode here.
Inside of a form, you should be able to use this.ActiveControl to get that information, which should provide you with a wealth of other information, such as the name of the control, type, etc.

How do you make a program with multiple "Pages"? [duplicate]

This question already has answers here:
Creating Wizards for Windows Forms in C#
(3 answers)
Closed 9 years ago.
How do you make something like the things where you install programs by clicking the "Next" button and it will show you like a TextBox instead of a ComboBox like on a new Panel?
Sort of like changing Tabs on a TabControl but without showing the tabs.
You are probably looking for Wizard. You may see
Simple Wizard for Winforms - CodeProject
You may also take a look at WinForms Wizard from DevExpress but its not free.

Disable resizing out of browser Silverlight 4 Window [duplicate]

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.

Categories

Resources