CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008
    Posts
    66

    Scrolling over usercontrol or form

    Hi all!

    In my app, both, the usercontrol and the form can be scrolled.

    I would like to add a function which the scrolling act is captured by the usercontrol if the mouse is over the usercontrol or by the form if the mouse is not over the usercontrol.

    Now, in my app, the scrolling action is captured by the form and by the usercontrol, but all the time even if the mouse is over the usercontrol, only the form gets this action (scrolling).

    How should I code in order to have this scrolling behavior in my app?

    Thank you in advance!
    Gustavo
    Last edited by gborges; February 26th, 2009 at 10:39 AM. Reason: Details

  2. #2
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Scrolling over usercontrol or form

    Whats about simple using the mousemove delegate of the form and checking if the mouse is just over the usercontrol and in that case simple turning of the scroll mechanism of the form. Havn't tested but IMHO that could work. Simple give it a try
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

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