Solved

Centering the Modal from in the application window

Posted on 1998-10-08
2
150 Views
Last Modified: 2010-04-30
I am working on MDI application. In which I want to make use of modal froms in the place of messgae boxes as I shouldn't use message boxes in my application. Problem is I will be using dual monitor systems, When I call the form it is diplayed some where else when the application is on other screen. how can I make the form to be visible in the application window only, means in the centre of the child form which called it.
0
Comment
Question by:lesa
2 Comments
 
LVL 3

Accepted Solution

by:
vmano earned 10 total points
ID: 1438834
set this property called "StartUpPosition : 2- centerscreen"
(i am not sure which version of VB are you using, if you can't find it let me know)

vmano
0
 
LVL 2

Expert Comment

by:shchuka
ID: 1438835
What version of VB are you using?  If it's version 5 or 6, you can use StartUpPosition property of the form.  Set it to 1 (CenterOwner), then display the form with

    frmModal.show vbModal, frmMdiChild.hwnd

If you're in VB version 3 or 4, you need to get the coordinates of the child window withing the mdi form, translate them into screen coordinates and then figure out the position for your modal form.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now