Solved

Centering a message box

Posted on 1998-12-03
5
186 Views
Last Modified: 2010-05-03
My application displays a window in the middle of the screen, not full size. the problem is when I call the MsgBox function the message box dialog displayes slightly below my apps window. Is there a way to center the message box window with respect to my application window?
Thank in Advance.
0
Comment
Question by:BlackRussian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 100 total points
ID: 1447990
BlackRussian,
You need to to make your own message box.
Just add anew form, call it frmMessage. Put a lable to display the message with a couple of command buttons.
When you need to display the message box, add
frmMessage.Show vbModal

You can control the position, font, back color, and add some animation in it.
Let me know if I can be more help
Regards
Dalin
0
 
LVL 14

Expert Comment

by:waty
ID: 1447991
Here is a link showing you how to center a Common Dialog - The Easy and the Hard Way

http://vbaccelerator.com/codelib/cmdlgd/cmdlgct.htm
http://vbaccelerator.com/codelib/cmdlgd/cmdlgd.htm


0
 
LVL 14

Expert Comment

by:waty
ID: 1447992
Here is a link showing you how to center a Common Dialog - The Easy and the Hard Way

http://vbaccelerator.com/codelib/cmdlgd/cmdlgct.htm
http://vbaccelerator.com/codelib/cmdlgd/cmdlgd.htm

0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1447993
You can try tweak with the original MessageBox API, which allows you to specify a parent window, and supposed to align it properly
0
 
LVL 3

Expert Comment

by:vmano
ID: 1447994
here is a very good example with code from MSDN article Q180936.
URL is:
http://support.microsoft.com/support/kb/articles/q180/9/36.asp?FR=0 

let me know if this helps,
vmano
 
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question