Click here to Skip to main content
15,898,374 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have two winform application and both two application running on one PC and two different monitors. When I click on massage button on second winform of second monitor that massage box popup on first monitor.

What I have tried:

I have try this code on second application but it's work sometimes. not all the time.

this.Location = Screen.AllScreens[1].WorkingArea.Location;
Posted
Updated 23-Oct-18 0:52am

You can give an object handle as the first parameter, like this:
Show(IWin32Window, String)
A simple example:
var result = MessageBox.Show(this, "Hello there !");

More information here: MessageBox.Show Method (System.Windows.Forms) | Microsoft Docs[^]
 
Share this answer
 
Comments
BillWoodruff 24-Oct-18 4:30am    
+5
Did you try MessageBoxOptions in MessageBox.Show(...)
 
Share this answer
 
Comments
BillWoodruff 24-Oct-18 4:30am    
Voted #5 to counteract an unwarranted down-vote.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900