usercontrol position in parent window


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: usercontrol position in parent window

  1. #1
    Alex Kennedy Guest

    usercontrol position in parent window



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

    Alex



  2. #2
    Karl E. Peterson Guest

    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!).

    Later... Karl
    --
    http://www.mvps.org/vb




  3. #3
    Karl E. Peterson Guest

    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!).

    Later... Karl
    --
    http://www.mvps.org/vb




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center