Wednesday, 15 August 2012

MouseWheel c# winforms when wheeling not stoping -



MouseWheel c# winforms when wheeling not stoping -

i set problem easy can.

i working on .dll dynamics crm visualstudio2010(ctrl add together in) in c# winforms. first of all, have panel(mainpanel) contains other controls:

then have panel(pncontroles) autoscroll set true(it happens utilize horizontal scroll due project requirements), , size , position defined. with same position smaller size have got panel pnintersection have autoscroll set false , add together mainpanel.

when doing scroll on pncontroles controls within , within pnintersection moves good. way, controls within panels textboxes. but, when intend mousewheel operation in horizontal scroll, textboxes within pnintersection did not move. in mousewheel event of pncontroles have said move textboxes inside. , say, mousewheel working fine both panels.

but, here comes problem, when scrollbar(on mousewheel operation) arrives ends(minimum , maximum position suppose), textboxes within pnintersection , pncontroles continues move if go on utilize wheel on mouse.

so, set code illustrate parafernalia, can give me hand or point me on right direction welcome post. trying disable mousewheel when arriving ends but, @ moment, no luck.

posting code:

private void wheelingpanel(panel pn, textbox tb, int saltox, int saltoy) { pn.mousewheel += (senderl, el) => { if (el.delta > 0) { tb.location = new point(tb.location.x + saltox, tb.location.y + saltoy); } else { tb.location = new point(tb.location.x - saltox, tb.location.y - saltoy); } }; }

i did function every time need utilize mousewheel on panel(pn) given textboxes(tb).

how can do, create textboxes on pnintersection stop, when mousewheel??

rafa

c# winforms panel mousewheel

No comments:

Post a Comment