c# - WinForms scrollable control touch behavior -
i have splitcontainer contains atalasoft's annotateviewer. class hierarchy follows:
system.windows.forms.control atalasoft.imaging.wincontrols.scrollport ... atalasoft.annotate.ui.annotateviewer my.annotateviewer
now problem: long content of splitcontainer smaller actual viewport, hence no scrollbars visible, touch input interpreted left mouse down, mouse move , left mouse i'd expect , love see. still use two-finger-panning scroll view. but: if zoom viewer, content gets larger viewport, scrollbars appear , touch input behaves differently: horizontal panning stays same, vertical panning causes scrolling, single finger.
the question is: behavior atalasoft-specific, winforms-specific or system-specific , can change it? i'd single finger convert left click , move. 2 finger's scrolling fine (and works.)
i fear system specific because can find exact same behavior in word 2010. still, it's microsoft product.
i begin hate fact sudden inspiration after typing down problem forum or similar.
this problem solved re-registering gesture events. able register pan gestures except horizontal and/or vertical single finger pan.
// adapt gesture registration window gestureconfig[] gestureconfig = new[] { // register zoom gesture new gestureconfig { dwid = gid_zoom, dwwant = gc_zoom, dwblock = 0 }, // register pan gestures ignore single finger (only use two-finger-pan scroll) new gestureconfig { dwid = gid_pan, dwwant = gc_pan, dwblock = gc_pan_with_single_finger_horizontally | gc_pan_with_single_finger_vertically } }; setgestureconfig(this.handle, 0, (uint)gestureconfig.length, gestureconfig, (uint)marshal.sizeof(typeof(gestureconfig)));
details here: http://msdn.microsoft.com/de-de/library/dd353241%28v=vs.85%29.aspx
i think cleanest solution can get.