Is it possible to find out a usercontrol's position within its parent window
i.e. not screen position (as returned by GetWindowRect)?

Alex

06-08-2000, 02:43 PM

Karl E. Peterson

Re: usercontrol position in parent window

Hi Alex --
> Is it possible to find out a usercontrol's position within its parent window
> i.e. not screen position (as returned by GetWindowRect)?

Just call GetWindowRect on UserControl.hWnd and GetParent(UserControl.hWnd) and do a
little math. Either that, or take a look at the Extender.Top and Extender.Left props
(with error trapping, because not all hosts implement these!).

Hi Alex --
> Is it possible to find out a usercontrol's position within its parent window
> i.e. not screen position (as returned by GetWindowRect)?

Just call GetWindowRect on UserControl.hWnd and GetParent(UserControl.hWnd) and do a
little math. Either that, or take a look at the Extender.Top and Extender.Left props
(with error trapping, because not all hosts implement these!).