Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default userform, StartUpPosition

Hi folks,

to position a user form rightmost on the monitor
I miss a preset constant for the property
StartUpPosition aside of 'manual', 'centerowner',
'centerscreen' and 'windows default'.

To set 'left' manually by a program-function at least
I need to detect the screenwidth of the present monitor
but do not know how.

Can somebody help me out, maybe even with a
code example right away (for not to invent the wheel
again :-) )?
Thanks.

Regards
Peter





  #2   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default userform, StartUpPosition

Peter

The following is code I got from this group and use a lot:

Application.WindowState = xlMaximized
Me.Top = 0
Me.Left = 0
Me.Height = Application.Height
Me.Width = Application.Width

Of course it does not do exactly what you want, but, I think it could
get you started. To position a userform to the right, you could go
with

Me.Left=Application.Width - Me.Width

and

Me.Left=0

will put it on the left. The maximizing statement may or may not be
relevant to your situation.

Good luck.

Ken
Norfolk, Va



Peter Ostermann wrote:
Hi folks,

to position a user form rightmost on the monitor
I miss a preset constant for the property
StartUpPosition aside of 'manual', 'centerowner',
'centerscreen' and 'windows default'.

To set 'left' manually by a program-function at least
I need to detect the screenwidth of the present monitor
but do not know how.

Can somebody help me out, maybe even with a
code example right away (for not to invent the wheel
again :-) )?
Thanks.

Regards
Peter


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default userform, StartUpPosition

Hi Ken,

you gave exactly the hint what I was looking for!
Thanks.

"Ken" wrote

Me.Left=Application.Width - Me.Width


Good luck.

Ken
Norfolk, Va

Greetings to Norfolk. I have
good memories to that place.

Peter
Oldenburg, NW-Germany
www.pkf-ostermann.de


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
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) Corey Excel Programming 2 January 9th 07 01:01 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
user form StartUpPosition chris[_10_] Excel Programming 1 February 23rd 04 03:10 AM
vbModal, VBA version, StartUpPosition Setting Shoji Karai Excel Programming 0 September 22nd 03 09:30 PM
vbModal, VBA version, StartUpPosition Setting Shoji Kaku Excel Programming 5 September 21st 03 10:01 PM


All times are GMT +1. The time now is 05:51 PM.

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

About Us

"It's about Microsoft Excel"