Msgbox on a certain Screen(n)

I have two screens (Mac und TV) and like that in case a MsgBox pops up, it is only shown on the Mac (Screen(0)).
However, depending on where I open certain types of windows, they pop up also on the TV screen (Screen(1)).
How can I make sure, MsgBoxs are only displayed on my Mac screen?

It probably depends on where the focus is. You need to set focus on an element in Screen(0) before calling MsgBox.

@Peter Kronenberg — Neither MsgBox not MessageDialog let you set the position of the window so I think that your best solution would be to use NSAlert (with declares or plugin) or to make your own message window in Xojo, which you can put on whichever screen you want.

Why ?

Imagine a second, that in that Monitor, another window from your application is displayed: how your user can understand who owns the MsgBox ? That is why I asked why you prefer the behavior you are asking.

Remember: you can move the MsgBox window to read what is behind it and if this is an error message, you can send them using System — Xojo documentation …

@ Emile: my application is suppose to show a quiz window via a beamer to a big audience (currently during development to a TV). All Msgboxes need only be shown on the laptop, not to the other screen (them).

I solved it so far, that when ever I do a window.show / refresh, etc. to the Screen(1) - the beamer, I immediately do a Window.setfous to my control panel on Screen(0). Whenever a informative (or error) Msgbox appears, it’s now for me, not them.
@ Michel: Thanks for the tip!