Trouble with Window Positioning

03-26-2006, 02:49 PM
I'm trying to position a window on top of an already open window and am having trouble. The from in question has two splitter controls on it, and I want the form that opens to be positioned so that the new winodw's upper left corner is the same location as the main splitter control's upper left corner. Here is the code I have but it doesn't work :(

Me.Width = Main.scMain.SplitterDistance + Main.scRecord.SplitterDistance
Me.Height = Main.scMain.Height

Dim x As Integer = Main.scmain.Location.X
Dim y As Integer = Main.scmain.Location.Y

Me.Location = New Point(x,y)

In fact this code doesn't even come close to doing what I want. So how exactly would I go about getting the proper location for my new window?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum