Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default determining coordinates for screen placement of user form

I set the StartupPosition of a UserForm to manual and wish to place it,
for example, in the lower right corner of the screen.

I use the API GetSystemMetrics function to return a screen width and
height, but then have to scale those measures down before subtracting
the width and height of the UserForm itself (to 60% for my 1400 x 1050
screen and 75% for my 1024 x 768 screen).

In other words, the screen width for UserForm placement purposes is
only 840 x 630 for a 1400 x 1050 screen and only 768 x 576 for a 1024 x
768 screen.

Question: Is there a way to determine this "scaling" factor
dynamically, so that the application always places the form where I
want it, regardless of the user's screen resolution?

I am sure this has been addressed many times, but my searches came up
empty. Any direction on this would be greatly appreciated. Thanks in
advance. :)


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default determining coordinates for screen placement of user form

Pat,

You might find my FormPositioner code useful. See
http://www.cpearson.com/excel/FormPosition.htm


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"PatFinegan " wrote
in message ...
I set the StartupPosition of a UserForm to manual and wish to

place it,
for example, in the lower right corner of the screen.

I use the API GetSystemMetrics function to return a screen

width and
height, but then have to scale those measures down before

subtracting
the width and height of the UserForm itself (to 60% for my 1400

x 1050
screen and 75% for my 1024 x 768 screen).

In other words, the screen width for UserForm placement

purposes is
only 840 x 630 for a 1400 x 1050 screen and only 768 x 576 for

a 1024 x
768 screen.

Question: Is there a way to determine this "scaling" factor
dynamically, so that the application always places the form

where I
want it, regardless of the user's screen resolution?

I am sure this has been addressed many times, but my searches

came up
empty. Any direction on this would be greatly appreciated.

Thanks in
advance. :)


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default determining coordinates for screen placement of user form

Thanks for the reference. Not sure my understanding is correct, but th
calculations seem tethered to the Application and ActiveWindow'
dimensions, as well as to a particular cell's coordinates.

I need something slightly different -- namely, the Form compatibl
coordinates of the lower right corner of the screen itself.

Purpose: 2 side-by-side or vertically positioned forms that shouldn'
run off the screen.

I can obviously figure out the conversion ratio manually, as I did i
my original post, by changing my screen resolution and experimenting
but it seems very inelegant. And doesn't help me for resolutions beyon
my monitor's maximum. I guess I can visit CompUSA and pretend I'
interested in a big monitor.

Please let me know if I've missed something. Thanks again

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining Last User Action COM Excel Programming 2 December 29th 03 03:21 PM
Determining end of user-selected range Syed Faisal Excel Programming 2 October 23rd 03 05:22 PM
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form BruceJ[_2_] Excel Programming 2 October 15th 03 05:28 PM
Screen Coordinates of a given cell in XL hglamy[_2_] Excel Programming 2 October 15th 03 02:03 PM
Activating a worksheet with a user form open on the screen KimberlyC Excel Programming 4 August 29th 03 08:44 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"