Link to home
Start Free TrialLog in
Avatar of BritishJeff
BritishJeffFlag for United States of America

asked on

Scrolling when doing a drag and drop in TableLayoutPanel (VS2005)

Hello,

I am trying to drag and drop a label control from one cell in a tablelayoutpanel to another (VB2005).  There is no problem if both cells are visible, but i cannot get the tablelayoutpanel to scroll in any direction (autoscroll is on), when the cell i want to drag to is not currently visible and requires (vertical) scrolling to get to see it.

Any suggestions would be greatly appreciated.

I have also noticed that my middle mouse scrollwheel no longer works for my tablelayoutpanel.  Weird as it worked when i first started developing the form, but now the TLP is on a panel, it no longer works at all. Is this normal, and how can i get it working again?

Thanks so much,

Jeff
Avatar of BritishJeff
BritishJeff
Flag of United States of America image

ASKER

OK, i found the solution to the second part of my question.  My TableLayoutPanel was filled with labels, and therefore, it never received the focus.  The Scroll Wheel only works on the control with the focus, so i added code to give the tlp the focus whenever the mouse entered.  It solved the problem with the scroll wheel, but i still have the issue with drag/drop and not having the tlp scroll vertically as you drag beyond the limits of the visible tlp.

    Private Sub tlp_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tlp.MouseEnter
        tlp.Focus()
    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial