Results 1 to 3 of 3

Thread: Need help with MouseMove function inside tabpages

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    2

    Need help with MouseMove function inside tabpages

    I was having trouble with a mousemove sub in the application I am working on. If I use the following :

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove

    the program will pick up mouse movements correctly around the perimeter of the tab pages. However, the sub does not respond to movements inside the tab pages. I thought this problem might be because Vb.net uses tabpages instead of tabcontrol to raise the event when the mouse position is inside the tab page, but even if this is the case, I still do not know how to modify the sub to pick up the movements. Could someone help me?
    Last edited by jacal; Jun 16th, 2005 at 07:10 PM.

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

    Re: Need help with MouseMove function inside tabpages

    well the form_mousemove event ISN'T supposed to capture mouse movement when you move the mouse over controls. It is only raised when the mouse is moved over an empty form area.
    If your question is how can you capture the mouse event for each single tab page then I guess you can dynamically add the event for all the tab pages. This adds the MouseMove event to all the tab pages:
    VB Code:
    1. Dim i As Integer
    2.         For i = 0 To TabControl1.TabCount - 1
    3.             AddHandler TabControl1.TabPages(i).MouseMove, AddressOf TabControl1_MouseMove
    4.         Next
    5.  
    6. Private Sub TabControl1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TabControl1.MouseMove     End Sub
    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!!

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    2

    Re: Need help with MouseMove function inside tabpages

    Okay, that works. Thank you.

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