PDA

View Full Version : Can't position dialog



Micromegas
05-04-2023, 11:30 AM
This is an odd behavior: When I try to position a dialog, it changes the position to a random value. In the below, ‘dlgTest’ is just any dialog; it even reproes with a completely empty dialog as produced by default by the IDE.


Sub Position_test()
With dlgTest
.StartUpPosition = 0
Debug.Print "before:", .StartUpPosition, .Top
.Top = 0
Debug.Print "after:", .StartUpPosition, .Top
End With
End Sub

This produces the following output:

before: 0 0
after: 0 -495

(In the real application, I tried to change the .Top to a value<>0, but here I chose 0 to make it clear that it even reproes when .Top shouldn't change at all.)

Aussiebear
05-04-2023, 06:17 PM
Perhaps have a look here for a hint or two. http://www.cpearson.com/Excel/FormPosition.htm

Micromegas
05-05-2023, 12:57 AM
The Form Positioner is there “ to display a form in relation to a specific cell”. What I need is much more basic - and presumably much simpler.