Results 1 to 2 of 2

Thread: MouseWheel event doesn't fire on TabPage

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Asheville, nc
    Posts
    53

    MouseWheel event doesn't fire on TabPage

    I have some controls on a tabPage (tabControl control) so that I have there a scroll bar. When I run my program, mouse wheel doesn't work. I added tabPage1_MouseWheel event to see if it is firing up, but it is not.

    I need your help to fix it or explain it.

    Thanks.
    Victor
    Victor

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: MouseWheel event doesn't fire on TabPage

    Quote Originally Posted by vkuzmich
    I have some controls on a tabPage (tabControl control) so that I have there a scroll bar. When I run my program, mouse wheel doesn't work. I added tabPage1_MouseWheel event to see if it is firing up, but it is not.

    I need your help to fix it or explain it.

    Thanks.
    Victor
    umm the event wont fire unless tabPage1 or a control in tabPage1 is the control which has the focus. I'm not really sure what a good solution to this would be, but what I thought of is to manually set the focus on tabPage1 as the mouse enters it.

    Code:
    private void tabPage1_MouseEnter(object sender, System.EventArgs e)
    		{
    			foreach (Control ctrl in tabPage1.Controls)
    			{
    				if (ctrl.Focused)
    					return;
    			}
    			tabPage1.Focus();
    		}
    what this does is that it checks to see if any control in tabPage1 has the focus, if so then do nothing because the mouseWheel event should fire. It not, then set the focus on tabpage1

    not the best solution in my opinion, I just dont know any other way
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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