Commit ef2a2866 HZH

树滚动条bug

1 个父辈 a19ac942
...@@ -62,10 +62,11 @@ namespace HZH_Controls.Controls.ScrollBar ...@@ -62,10 +62,11 @@ namespace HZH_Controls.Controls.ScrollBar
control.SizeChanged += control_SizeChanged; control.SizeChanged += control_SizeChanged;
control.LocationChanged += control_LocationChanged; control.LocationChanged += control_LocationChanged;
control.Disposed += control_Disposed; control.Disposed += control_Disposed;
if (control is TreeView) if (control is TreeView)
{ {
TreeView tv = (TreeView)control; TreeView tv = (TreeView)control;
tv.MouseWheel += tv_MouseWheel; tv.MouseWheel += tv_MouseWheel;
tv.AfterSelect += tv_AfterSelect; tv.AfterSelect += tv_AfterSelect;
tv.AfterExpand += tv_AfterExpand; tv.AfterExpand += tv_AfterExpand;
tv.AfterCollapse += tv_AfterCollapse; tv.AfterCollapse += tv_AfterCollapse;
...@@ -326,7 +327,7 @@ namespace HZH_Controls.Controls.ScrollBar ...@@ -326,7 +327,7 @@ namespace HZH_Controls.Controls.ScrollBar
{ {
if (intY >= tns[i].Bounds.Top - tv.Nodes[0].Bounds.Top - 3 && intY <= tns[i].Bounds.Bottom - tv.Nodes[0].Bounds.Top + 3) if (intY >= tns[i].Bounds.Top - tv.Nodes[0].Bounds.Top - 3 && intY <= tns[i].Bounds.Bottom - tv.Nodes[0].Bounds.Top + 3)
{ {
tv.SelectedNode = tns[i]; tns[i].EnsureVisible();
return true; return true;
} }
else if (tns[i].IsExpanded && tns[i].Nodes.Count > 0) else if (tns[i].IsExpanded && tns[i].Nodes.Count > 0)
......
...@@ -28,10 +28,12 @@ ...@@ -28,10 +28,12 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
this.tvMenu = new HZH_Controls.Controls.TreeViewEx(); this.tvMenu = new HZH_Controls.Controls.TreeViewEx();
this.ucSplitLine_V1 = new HZH_Controls.Controls.UCSplitLine_V(); this.ucSplitLine_V1 = new HZH_Controls.Controls.UCSplitLine_V();
this.panControl = new System.Windows.Forms.Panel(); this.panControl = new System.Windows.Forms.Panel();
this.scrollbarComponent1 = new HZH_Controls.Controls.ScrollBar.ScrollbarComponent(this.components);
this.SuspendLayout(); this.SuspendLayout();
// //
// tvMenu // tvMenu
...@@ -66,6 +68,7 @@ ...@@ -66,6 +68,7 @@
this.tvMenu.TabIndex = 7; this.tvMenu.TabIndex = 7;
this.tvMenu.TipFont = new System.Drawing.Font("Arial Unicode MS", 12F); this.tvMenu.TipFont = new System.Drawing.Font("Arial Unicode MS", 12F);
this.tvMenu.TipImage = ((System.Drawing.Image)(resources.GetObject("tvMenu.TipImage"))); this.tvMenu.TipImage = ((System.Drawing.Image)(resources.GetObject("tvMenu.TipImage")));
this.scrollbarComponent1.SetUserCustomScrollbar(this.tvMenu, true);
this.tvMenu.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvMenu_AfterSelect); this.tvMenu.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvMenu_AfterSelect);
// //
// ucSplitLine_V1 // ucSplitLine_V1
...@@ -86,6 +89,7 @@ ...@@ -86,6 +89,7 @@
this.panControl.Name = "panControl"; this.panControl.Name = "panControl";
this.panControl.Size = new System.Drawing.Size(815, 707); this.panControl.Size = new System.Drawing.Size(815, 707);
this.panControl.TabIndex = 9; this.panControl.TabIndex = 9;
this.scrollbarComponent1.SetUserCustomScrollbar(this.panControl, true);
// //
// FrmMain // FrmMain
// //
...@@ -115,5 +119,6 @@ ...@@ -115,5 +119,6 @@
private HZH_Controls.Controls.TreeViewEx tvMenu; private HZH_Controls.Controls.TreeViewEx tvMenu;
private HZH_Controls.Controls.UCSplitLine_V ucSplitLine_V1; private HZH_Controls.Controls.UCSplitLine_V ucSplitLine_V1;
private System.Windows.Forms.Panel panControl; private System.Windows.Forms.Panel panControl;
private HZH_Controls.Controls.ScrollBar.ScrollbarComponent scrollbarComponent1;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -162,6 +162,9 @@ ...@@ -162,6 +162,9 @@
KfUq3QAAAABJRU5ErkJggg== KfUq3QAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<metadata name="scrollbarComponent1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAAEAeIAAAAEAIAAo+AAAFgAAACgAAAB4AAAAAAEAAAEAIAAAAAAAAPAAAGDqAABg6gAAAAAAAAAA AAABAAEAeIAAAAEAIAAo+AAAFgAAACgAAAB4AAAAAAEAAAEAIAAAAAAAAPAAAGDqAABg6gAAAAAAAAAA
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!