Solved

How to enable mousewill in VB.NET splitcontainer?

Posted on 2008-10-26
4
973 Views
Last Modified: 2012-08-13
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
Comment
Question by:afikim
  • 2
4 Comments
 

Author Comment

by:afikim
ID: 22808597
Sorry for the typo = mousewill=mousewheel ;-)
0
 
LVL 8

Expert Comment

by:jorgesv13
ID: 22810124
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
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 125 total points
ID: 22810128
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
 

Author Closing Comment

by:afikim
ID: 31510144
Thanks Idle_Mind
Great and easy solution - both to understand and to implement.

Eli
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question