Set Primary Monitor (Screen) by code

How can I set / switch the Primary Monitor by programm/code.

Peter

SetPrimaryMonitor
LVL 1
PeterInStingbertAsked:
Who is Participating?
 
Carlos VillegasConnect With a Mentor Full Stack .NET DeveloperCommented:
Hello, this is another project, have you tried this?
http://www.codeproject.com/KB/dotnet/Display_Settings.aspx

Please test the example, the problem is, I don't have two monitors in my system to test it :(

Tell me if it works for you, if it does I can help you to extract only the code required to set your primary monitor.
0
 
Carlos VillegasFull Stack .NET DeveloperCommented:
Hello, I think this will be useful to you:
http://www.codeproject.com/KB/system/Set_Primary_Display.aspx
0
 
PeterInStingbertAuthor Commented:
Thank you,
i know this codeproject article.
1)  th author says:  > The code is left raw for addition of "bells and whistles". <.
yes,  ... and any comments.

2) this code bring my system to "blue screen"

Are there other examples with more explanations ?

Peter
0
 
Carlos VillegasFull Stack .NET DeveloperCommented:
Hello, I will investigate more about this, I'll let you know.
0
 
PeterInStingbertAuthor Commented:
Sorry i was very busy...
thank you for the solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.