CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    India
    Posts
    15

    How to Get the actual point when clicked in a ScrollView ??

    Hi,

    I am using CScrollView and my intial window is not maximized. So when I scroll down and tries to click in the view area, then funtion OnLButtonDown() returns point relative to the visible window, I mean not the actual point of the full view.

    Can you pls tell me the way out.

    With best regards,
    Kapil



  2. #2
    Join Date
    May 1999
    Posts
    7

    Re: How to Get the actual point when clicked in a ScrollView ??

    Something like this should work. If you have some zooming involved, you'll have to do some scaling too.

    OnLButtonDown(UINT nFlags, CPoint point)
    {

    CPoint scrollPos = GetScrollPosition();
    point.y += scrollPos.y;
    point.x += scrollPos.x;
    ...
    }

    Hope this helps.

    Damir


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured