123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Windows.Forms;
- using System.ComponentModel;
- namespace FastReport.FastQueryBuilder
- {
- #if !DEBUG
- [DesignTimeVisible(false)]
- #endif
- class FqbCheckedListBox : CheckedListBox
- {
- private const int WM_HSCROLL = 0x114;
- private const int WM_VSCROLL = 0x115;
- public event ScrollEventHandler HorzScrollValueChanged;
- public event ScrollEventHandler VertScrollValueChanged;
-
- protected override void WndProc(ref Message m)
- {
- base.WndProc (ref m);
- if ( m.Msg == WM_HSCROLL )
- {
- if ( HorzScrollValueChanged != null )
- {
- uint wParam = (uint)m.WParam.ToInt32();
- HorzScrollValueChanged( this,
- new ScrollEventArgs(
- GetEventType( wParam & 0xffff), (int)(wParam >> 16) ) );
- }
- }
- else if ( m.Msg == WM_VSCROLL )
- {
- if ( VertScrollValueChanged != null )
- {
- uint wParam = (uint)m.WParam.ToInt32();
- VertScrollValueChanged( this,
- new ScrollEventArgs(
- GetEventType( wParam & 0xffff), (int)(wParam >> 16) ) );
- }
- }
- }
- private static ScrollEventType [] _events =
- new ScrollEventType[] {
- ScrollEventType.SmallDecrement,
- ScrollEventType.SmallIncrement,
- ScrollEventType.LargeDecrement,
- ScrollEventType.LargeIncrement,
- ScrollEventType.ThumbPosition,
- ScrollEventType.ThumbTrack,
- ScrollEventType.First,
- ScrollEventType.Last,
- ScrollEventType.EndScroll
- };
- private ScrollEventType GetEventType( uint wParam )
- {
- if ( wParam < _events.Length )
- return _events[wParam];
- else
- return ScrollEventType.EndScroll;
- }
- }
- }
|