views:

275

answers:

1

Windows 7, .NET 3.5
I need to know when netbook (small laptop, but normal Windows 7) changes orientation (there is a button on the netbook that is used to switch landscape/portrait orientation).

This tells me the orientation, but I am looking for the change notification event:

System.Windows.Forms.SystemInformation.ScreenOrientation

Do I have to reference WindowsMobile to get that?

+1  A: 

There is no such event as far as I am concerned. There is however a MSDN article covering this using a different technique. I guess you could write some sort of wrapper for this to work with ScreenOrientation

Timo Willemsen
I'd give you +1 for the link but you said there's no such event when the article you linked to says the event is the Microsoft.Win32.SystemEvents.DisplaySettingsChanged event.
David Stratton
@David Stratton, I'm sorry yes you are correct. But the `System.Windows.Forms.SystemInformation.ScreenOrientation` is not directly compatible with the `Microsoft.Win32.SystemEvents.DisplaySettingsChanged` event. You'll still have to code something around it.
Timo Willemsen
Right, that code is provided in your link.
Hans Passant