Link to home
Start Free TrialLog in
Avatar of thready
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
ASKER CERTIFIED SOLUTION
Avatar of kris_per
kris_per

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
I too agree with kris_per

Regards,
VSS
Avatar of thready
thready

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
Avatar of thready

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())
Avatar of thready

ASKER

ok - I was able to set Focus on the panel - but it still won't scroll when I use the mouse wheel...
SOLUTION
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
Avatar of thready

ASKER

thanks