Jarod Posted May 8, 2003 Posted May 8, 2003 Can we decide of the starting position of the message boxes ? In fact my soft runs on a dual screen configuration and so all my messagebox are shown at the center of the screen resolution that is to say between my two screens... a little bit annoying... So is there a way to ask a Message Box to pop up centered in a parent window or giving it a special position ? (Of course it is possible to reimplement it with the forms, but I would prefer to avoid that...) Thanks, Quote Jarod
hog Posted May 8, 2003 Posted May 8, 2003 Constructors 7 to 12 of the MessageBox class have the first parameter being the windows form for which the message box will be displayed in front of Quote My website
Jarod Posted May 8, 2003 Author Posted May 8, 2003 Yes but these constructers are only used to construct an owned dialog box (so minimize and maximize with its parent, no specific task icon, ...) But the dialog box still appears at the center of the screen Quote Jarod
*Experts* Nerseus Posted May 8, 2003 *Experts* Posted May 8, 2003 Search for "SetWindowsHookEx MessageBox" in Google, you'll find lots of answers. But overriding the position of the MessageBox is not simple as it involves windows hooks. Most of the articles you'll find will give good sample code though, so you don't have to worry too much. -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Jarod Posted May 9, 2003 Author Posted May 9, 2003 Ok one question however ! SetWindowsHookEx ask for a procedure address In an exemple I found : lgHook = SetWindowsHookEx(WH_CBT, AddressOf WinProc, lgInst, lgId) But this doesn't work, seems to be VB code and not VB.NET In my Case, I have a cast error So how can we "translate" the address of a procedure into a long ? Quote Jarod
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.