1

I have a winforms app which functions as an alert system, however a lot of the people who will use my program will have multiple screens. The alerts are time sensitive, so ideally I'd like them to appear on all screen, or to be able to specify a screen, so the user is more likely to notice it. By default the message boxes appear on the main screen, and I can't find any info on anything really to do with winforms and different monitors.

The doesn't even have to be a message box, if there is another winform function which can be made to do the same functionality but also multiple screens that'd be great.

On a side note is it possible to close multiple messageboxes from only 1 being accepted?

bob
  • 209
  • 1
  • 2
  • 12
  • How about using a *ding* + http://stackoverflow.com/questions/11309827/window-application-flash-like-orange-on-taskbar-when-minimize – L.B Aug 31 '14 at 21:51
  • This is great, and I eventually want to incorporate this, however the alert has Yes/No were clicking yes then performs a task, so the popup is very important as a means to present the user with the yes/no option. I was also thinking of making it a Steam/Skype style corner slide-up message box, but not sure if they attention grabbing enough. – bob Aug 31 '14 at 22:23
  • BTW: You still have the option of creating a custom form and setting `TopMost` property to true. – L.B Aug 31 '14 at 22:29
  • There's only one way to make this kind of *dinging* reliable, it cannot be done with MessageBox. It will simply disappear behind the window that the user is working with. You have to use NotifyIcon. – Hans Passant Aug 31 '14 at 22:41
  • 2
    Those are both about showing a single form on a single monitor of choice. You seem to want multiple forms to appear. You would have to launch the app, and using the advice in those links, pop a form for each screen, centered. But I would warn that unless you're warning of an impending user death, you'll just be the most annoying thing on the PC. – DonBoitnott Sep 02 '14 at 16:11
  • Why don't you just telepathically send the message to the user only once? – SimpleVar Sep 02 '14 at 16:15
  • Here's a clear Answer http://stackoverflow.com/questions/25627757/have-winform-appear-on-all-existing-monitors-at-same-time-its-an-alert-window/25629361#25629361 –  Mar 07 '15 at 21:59

1 Answers1

3

I think the easiest thing to do is create a custom form rather than using the existing message box. That way you can use the Show method rather than ShowDialog. This would allow you show multiple forms and close all of them from a single response.

As to placing them on multiple screens: You can find the existing screens with System.Windows.Forms.Screen.AllScreens. Each one of those has a Bounds property which will show you what the coordinates and size of each screen is. After you create each custom form you can specify it's Location property to place it on the screen of your choice.

MikeH
  • 4,242
  • 1
  • 17
  • 32
  • Sorry for not accpting earlier, but this is exactly what I needed to do. Using a form window instead of a message box is perfect, thank you. – bob Sep 02 '14 at 13:47