[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Scrolling with mousewheel doesn't scroll a FlowLayoutPanel

Posted on 2009-04-10
3
Medium Priority
?
2,945 Views
Last Modified: 2013-12-17
(C# .NET 2.0) I have a form with a TabControl, and inside many of the tabs is a FlowLayoutPanel containing multiple images. I am unable to scroll up/down these FlowLayoutPanels with the mouse wheel - I can only do it by dragging the scrollbar at the side which is a bit of an inconvenience. How can I set some sort of method to recognise the wheel being scrolled if the mouse is within the area of the FlowLayoutPanel, and if so move the panel up and down?

Also I would like to add that the mouse does successfully scroll the panel on my laptop using the scroll side of the touchpad, yet if I plug a mouse into the laptop and use its wheel it doesn't scroll with it, so the panel is obviously only responding to certain mouse drivers it seems. Any help would be appreciated.
0
Comment
Question by:smickell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 24120412
You need to give your FlowLayoutPanel focus:

        private void flowLayoutPanel1_MouseEnter(object sender, EventArgs e)
        {
            flowLayoutPanel1.Focus();
        }

You may need to do the same thing with the PictureBoxes (I assume).  That is to say, on MouseEnter() for the PictureBoxes, give focus to "flowLayoutPanel1".
0
 

Author Comment

by:smickell
ID: 24121641
As easy as that! I didn't think that would be needed because I already tried just clicking on the FLP, keeping the mouse in that spot (so it still had 'focus') and scrolling and it made no difference.
I didn't seem to need to create an additional event for the pictureboxes, the FLP is still scrollable even when hovered over the picturebox.
Many thanks Idle_Mind and have yourself a nice 500pts.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 24122165
It just depends on how much "margin" there is between the edge of your FlowLayoutPanel and the PictureBoxes.  If the margin is very small and the user is moving the mouse fast...then the MouseEnter() event might not fire for the FlowLayoutPanel (it might instead go directly to the PictureBox).
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

649 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