• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1017
  • Last Modified:

How to enable mousewill in VB.NET splitcontainer?

Hello

I have a SplitContainer which in one of it's panels I embeded a picturebox.
When the panel is smaller than the image, I can see the scrolls.  BUT, when I scroll the mouse wheel, nothing happens.

Any idea

Thanks

Eli
0
afikim
Asked:
afikim
  • 2
1 Solution
 
afikimAuthor Commented:
Sorry for the typo = mousewill=mousewheel ;-)
0
 
jorgesv13Commented:
I had the same problem some time ago, and must tell you, there's no easy way to accomplish it.

What I did is to handle the "MouseWheel" event of my form, and then scroll programatically set the scrolling of the panel based on the delta property of the event
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
When the mouse enters the PictureBox, give Focus to the parent container instead.  Then the mouse wheel will scroll the SplitContainer instead:



    Private Sub PictureBox1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
        PictureBox1.Parent.Focus()
    End Sub

Open in new window

0
 
afikimAuthor Commented:
Thanks Idle_Mind
Great and easy solution - both to understand and to implement.

Eli
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now