thready
asked on
C# cannot scroll with mouse wheel
Hi Experts,
I have a Windows Forms app (Visual C# 2008) which shows an explorer-like app where each node in the tree on the left shows a different scrollable form on the right. When I select a different node, the only way I can scroll with the mouse is if I can click on a control that can grab the input focus. Is there any way to do this better?
Thanks!
Mike
I have a Windows Forms app (Visual C# 2008) which shows an explorer-like app where each node in the tree on the left shows a different scrollable form on the right. When I select a different node, the only way I can scroll with the mouse is if I can click on a control that can grab the input focus. Is there any way to do this better?
Thanks!
Mike
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Set the focus to which control? One of the textboxes in the panel? I don't think I can select the panel itself...
Hi,
Shift focus on your form as: (on clicking node)
Form1.ActiveForm.Focus();
And now your form1 should have focus.
Regards,
VSS
Shift focus on your form as: (on clicking node)
Form1.ActiveForm.Focus();
And now your form1 should have focus.
Regards,
VSS
ASKER
I should have specified, I'm using a splitcontainer - the Panel2 of splitcontainer is the one I want to have focus.... But setting focus on a panel doesn't have any effect...
> on the left shows a different scrollable form on the right.
You can try setting the focus to this form (like form.Focus())
ASKER
ok - I was able to set Focus on the panel - but it still won't scroll when I use the mouse wheel...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
Regards,
VSS