HughLerwill
Programmer
I have the following which works well but I'm sure there a couple of API's which would do the job more smoothly
Any ideas?
Code:
Private Function GetControlPosRefForm(ByVal Ctrl As Object) As POINTAPI
'Returns the position of a Control, possibly nested inside Containers, with reference to the coordinates of the Parent Form's client area
'Only viable if ScaleMode on the Form and all Containers is VbTwips
Dim x!, y!
x = Ctrl.Left
y = Ctrl.Top
Do Until TypeOf Ctrl.Container Is Form
Set Ctrl = Ctrl.Container
x = x + Ctrl.Left
y = y + Ctrl.Top
Loop
GetControlPosRefForm.x = x
GetControlPosRefForm.y = y
End Function
Any ideas?