Sub Form location relative to Main form

MAC 0S

I want a sub form to open with its Top and Left location in a particular loaction relative to the main Form. Is this possible?

For example my “2nd” form opens with its Top/Left corner 2 inches from the TOP/LEFT corner of my main form.

Thanks
jim

To get specific positioning like that you’ll have to write your own function. If you set the window Behavior/Placement setting in the IDE to “Parent Window Screen” the window will position itself relative to the currently open window for you.

Something like this might work, but this is untested.

[code]Public Sub ShowNextTo(twinTarget as Window, tbOnTheRight as Boolean)
const kSpacing = 4

self.Top = twinTarget.Top

if tbOnTheRight then
self.Left = twinTarget.Left + twinTarget.Width + kSpacing

else
self.Left = twinTarget.Left - self.Width - kSpacing

end
End Sub
[/code]

Edit: You would use it like this

dim toPanel as new winSubform
toPanel.ShowNextTo(self)

Tim
Once again thanks!

Using your suggestion I simplefied it to

self.Top=Form_HomeScreen.top + 160
self.left=Form_HomeScreen.left + 310

Works great
Thanks
jim