Windows Desktop Size changed event? [duplicate] - c#

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Detect change of resolution c# WinForms
I have an application written in C# where my window is docked to the edge of the screen.
I need to know where I can find the event if the resolution has changed so I can call the Dock method so I can repaint my window.
On the form object I can only see the SystemColorsChanged event.

You're looking for the SystemEvents.DisplaySettingsChanged event.

Related

How to check if the WPF Window is being dragged [duplicate]

This question already has answers here:
Determining when a WPF window is being moved
(3 answers)
Closed 7 years ago.
In need to get whether or not my WPF application's Window is currently in the process of being dragged or re-sized. I need to prevent a specific action from happening if this is the case.
I need to check if the window is currently in any situation where the mouse is being held down on the the part of the window that can preposition it.
I am assuming there is probably some information somewhere on the
Application.Current.MainWindow
property. Or maybe there is a few events that I need to keep track of to have this information.
Any ideas how I would do this? Thanks in advance.
Subscribe to the LocationChanged event.
Set the ResizeBegin and ResizeEnd event. They should both fire when the application is being moved, and disable your feature when Begin is called and until End finishes.
EDIT: Just realized this is WPF, in which case check this article: Determining when a WPF window is being moved

Calculator windows forms c# [duplicate]

This question already has an answer here:
Capture keyboard inputs without a textbox
(1 answer)
Closed 7 years ago.
I'm working on an university project of a windows forms calculator with c#.
Is fully functional, but the question is.
Can I insert numbers in the main textBox without focusing on it. I want it to work like windows calculator and insert numbers without having to click the textbox.
I've try a lot of methods like using the event Key_Press directly on the form but nothing works.
Ps. Is like windows calculator.
Set the Form.KeyPreview property to true and handle the Form_KeyPress event.

Opacity in C#: form only, not controls [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I add transparency to a c# form while keeping controls visible?
I am working with C# form with panel1.
I have set Opacity=30% for Form1, But I reflect on panel1.
Any help me to by code to set Opacity 30% only on the form, not in panel1?
You cannot do that. The form's opacity is applied to the whole form, and it's children. Sorry - not possible with out-of-the-box C# functionality.

Moving a form in C# without a border? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
C# - Make a borderless form movable?
Drag borderless windows form by mouse
Ok, I have made a form with a control in it. The form is borderless. The control inside the form is called navigationPanel1. I want to be able to click and drag on the control to move the form. How do i do that?
You have to subscribe for the mouse-down, mouse-up and mouse-move events. In the mouse-move you set the location of your form to the new location (this u have to calculate). the code in mouse-move only should be executet if the mouse-button is down (save this state)

How to prevent stealing focus when clicking on a usercontrol? [duplicate]

This question already has answers here:
Is there a way to make a UserControl unfocussable?
(6 answers)
Closed 8 years ago.
I want to be able to click on my user control and not have it steal focus from any other control. I know when you click on a label it doesn't steal focus. How can this be done?
Try disabling your control's ControlStyles.Selectable flag.

Categories