Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect change of resolution c# WinForms

Tags:

c#

.net

winforms

is there an easy way to hook to an event that is triggered on change of global screen resolution?

like image 499
Matze Avatar asked Jan 14 '09 09:01

Matze


2 Answers

Handle the following event:

Microsoft.Win32.SystemEvents.DisplaySettingsChanged 

You may refer to this page for more details.

You may also wanna see the msdn article on SystemEvents class.

like image 121
Frederick The Fool Avatar answered Sep 17 '22 20:09

Frederick The Fool


There are two events - SystemEvents.DisplaySettingsChanged and SystemEvents.DisplayedSettingsChanging which you can handle. Note that both events are static and you will need to detach your handlers before exiting from your program.

like image 44
Radoslav Hristov Avatar answered Sep 19 '22 20:09

Radoslav Hristov