Positioning Msgboxes and Common Dialog Boxes

  • Thread starter Thread starter jcrouse
  • Start date Start date
J

jcrouse

In VB .Net is it possible to specify a location (x, y) for message boxes and
the common dialog box class like you can do for windows forms? If so, how is
this accomplished?

Thank you,
John
 
The short answer is no.
The longer answer is that this can be accomplished by using Win32 API calls.
However, in practice I have found it to be problematic sometimes and can have
some undesirable side effects.
Some video drivers try to control where things pop-up, especially in the case of
multiple monitors and other cases.
This can cause some real weirdness, or dialogs pop up in one place, then move to
the other, etc.
In the end, I personally have decided it is more trouble than it is worth and
just let them pop-up where they want.
IF I really need something at a particular place, then I make a custom form and
display it where I want.

Gerald
 
* "jcrouse said:
In VB .Net is it possible to specify a location (x, y) for message boxes and
the common dialog box class like you can do for windows forms? If so, how is
this accomplished?

You can do that with a Win32 dialog hook (p/invoke on 'SetWindowsHookEx'
etc.).
 
Back
Top