PC Review


Reply
Thread Tools Rate Thread

How can I Center a Dialog Box each time a user opens it?

 
 
=?Utf-8?B?QmFuZGl0?=
Guest
Posts: n/a
 
      26th Oct 2006
I have a custom dialog box with dropdrowns etc used to select options.
Each time you click the command buttion that shows the dialog box the box
moves towards the upper left corner of the worksheet? How can I center the
dialog each time it is shown?. Are there methods to control the position of a
dialog using VBA or other means?
 
Reply With Quote
 
 
 
 
Zone
Guest
Posts: n/a
 
      26th Oct 2006
Bandit, if you're talking about a userform, follow these steps:
1. Display the userform in the VBA editor
2. Display the userform properties.
3. In the userform properties, set Startup Position to manual.
4. Copy this code and paste to your userform module:

Private Sub UserForm_Initialize()
Me.Left = Application.Width / 2 - Me.Width / 2
Me.Top = Application.Height / 2 - Me.Height / 2
End Sub

James

Bandit wrote:
> I have a custom dialog box with dropdrowns etc used to select options.
> Each time you click the command buttion that shows the dialog box the box
> moves towards the upper left corner of the worksheet? How can I center the
> dialog each time it is shown?. Are there methods to control the position of a
> dialog using VBA or other means?


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bypass the first time user ID dialog with Access 2003? (2nd request) mat Microsoft Access Form Coding 0 3rd Dec 2008 05:38 PM
How to bypass the first time user ID dialog with Access 2003 mat Microsoft Access Form Coding 0 26th Nov 2008 09:12 PM
program no longer opens in my user account--opens with others =?Utf-8?B?TWFyeQ==?= Windows XP Help 0 13th Mar 2006 08:43 PM
form only opens for one user at a time Redbeard Microsoft Access 16 19th Oct 2005 01:41 AM
folder "System 32" opens each time new user opens lori Windows XP General 3 10th Jan 2004 09:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:28 PM.