DoubleBufferPanel: Fix scrolling inconsistencies
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
@@ -17,8 +19,7 @@ namespace CsvView
|
|||||||
ControlStyles.SupportsTransparentBackColor
|
ControlStyles.SupportsTransparentBackColor
|
||||||
, true);
|
, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||||
public static extern int SendMessage(IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam);
|
public static extern int SendMessage(IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam);
|
||||||
|
|
||||||
@@ -37,5 +38,19 @@ namespace CsvView
|
|||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DefaultValue(false)]
|
||||||
|
[Localizable(false)]
|
||||||
|
[Category("CatLayout")]
|
||||||
|
[Description("DisableAutoScrollDescr")]
|
||||||
|
public bool DisableAutoScroll { get; set; }
|
||||||
|
|
||||||
|
protected override Point ScrollToControl(Control activeControl)
|
||||||
|
{
|
||||||
|
if (DisableAutoScroll)
|
||||||
|
{
|
||||||
|
return DisplayRectangle.Location;
|
||||||
|
}
|
||||||
|
return base.ScrollToControl(activeControl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
FrmCsvViewer.Designer.cs
generated
1
FrmCsvViewer.Designer.cs
generated
@@ -170,6 +170,7 @@
|
|||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.pnlData.AutoScroll = true;
|
this.pnlData.AutoScroll = true;
|
||||||
this.pnlData.Location = new System.Drawing.Point(0, 37);
|
this.pnlData.Location = new System.Drawing.Point(0, 37);
|
||||||
|
this.pnlData.DisableAutoScroll = true;
|
||||||
this.pnlData.Name = "pnlData";
|
this.pnlData.Name = "pnlData";
|
||||||
this.pnlData.Size = new System.Drawing.Size(508, 432);
|
this.pnlData.Size = new System.Drawing.Size(508, 432);
|
||||||
this.pnlData.TabIndex = 11;
|
this.pnlData.TabIndex = 11;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace CsvView
|
namespace CsvView
|
||||||
@@ -150,6 +149,7 @@ namespace CsvView
|
|||||||
|
|
||||||
pnlData.SuspendDrawing();
|
pnlData.SuspendDrawing();
|
||||||
|
|
||||||
|
pnlData.VerticalScroll.Value = 0;
|
||||||
pnlData.Controls.Clear();
|
pnlData.Controls.Clear();
|
||||||
_currentReg = currentReg;
|
_currentReg = currentReg;
|
||||||
txtCurrentReg.Text = Convert.ToString(currentReg);
|
txtCurrentReg.Text = Convert.ToString(currentReg);
|
||||||
@@ -208,6 +208,7 @@ namespace CsvView
|
|||||||
|
|
||||||
pnlData.SuspendDrawing();
|
pnlData.SuspendDrawing();
|
||||||
|
|
||||||
|
pnlData.VerticalScroll.Value = 0;
|
||||||
pnlData.Controls.Clear();
|
pnlData.Controls.Clear();
|
||||||
pnlReg.Enabled = false;
|
pnlReg.Enabled = false;
|
||||||
txtCurrentReg.Text = string.Empty;
|
txtCurrentReg.Text = string.Empty;
|
||||||
|
|||||||
Reference in New Issue
Block a user