OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 17-06-2005, 13:40
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default Dialog placement

Is there a way to have my forms popup at specific x,y point on the screen rather than dead center. I have a macro thatcycle thruogh every page in a document and presents a form on every page. I'm not even really concerned about the exact x,y position, but rather a top left or top right type of situation.
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
Old 17-06-2005, 15:23
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
Join Date: Mar 2005
Posts: 836
Default dialog placement

I would do this way:
declare function findwindow lib "user32" - to find your window handle (by "me.caption" for example)

declare function setwindowpos lib "user32" - to set window position
Reply With Quote
Old 17-06-2005, 15:26
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4

See the following methods of the form: StartUpPosition, Left, Top.

You need to ensure that StartUpPosition is set to "0", which gives you the ability to specify form's location. Then use Left and Top properties to specify the actual location on the screen. Here is an example on how to do this programmatically:

Public Sub NewPageNums()
    Load frmNumberPage
    frmNumberPage.StartUpPosition = 0 ' Specify position manually
    frmNumberPage.Left = 0
    frmNumberPage.Top = 0
    frmNumberPage.Show vbModal
End Sub
Obviously, you can set these values in the Properties window in Form designer while creating your form in VBA. This way you won't need to create the above code and just calling UserForm.Show will show the form at the right location...
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW-TO call coreldraw12 find dialog from VBA code???? wOxxOm CorelDRAW/Corel DESIGNER VBA 4 02-03-2008 08:32
Problem with Common Dialog in Corel VBA RobC CorelDRAW/Corel DESIGNER VBA 3 13-05-2005 14:43
Importing from dialog... ddonnahoe CorelDRAW/Corel DESIGNER VBA 0 25-01-2005 08:26
format text dialog box implement graphicdesigner CorelDRAW/Corel DESIGNER VBA 5 22-12-2004 13:37
Missing font dialog on import click101 CorelDRAW/Corel DESIGNER VBA 2 28-04-2003 12:32

All times are GMT -5. The time now is 03:41.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com