12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System.ComponentModel;
- using System.Drawing;
- using System.Windows.Forms;
- namespace SmartCoalApplication.SystemLayer
- {
- public class ScrollPanel : Panel
- {
- private bool ignoreSetFocus = false;
- public bool IgnoreSetFocus
- {
- get
- {
- return ignoreSetFocus;
- }
- set
- {
- ignoreSetFocus = value;
- }
- }
- [Browsable(false)]
- public Point ScrollPosition
- {
- get
- {
- return new Point(-AutoScrollPosition.X, -AutoScrollPosition.Y);
- }
- set
- {
- AutoScrollPosition = value;
- }
- }
- protected override void WndProc(ref Message m)
- {
- switch (m.Msg)
- {
- case NativeConstants.WM_SETFOCUS:
- if (IgnoreSetFocus)
- {
- return;
- }
- else
- {
- goto default;
- }
- default:
- base.WndProc(ref m);
- break;
- }
- }
- }
- }
|