Commit 96a9f36b 杨彭伟

1.解决GetTreeNodeMaxX方法中,节点列表为空时异常(line:408)

2.解决control_SizeChanged方法中,从缓存控件的父控件中,移除处于显示中的控件(line:193)
1 个父辈 fe243a50
...@@ -7,3 +7,4 @@ ...@@ -7,3 +7,4 @@
/HZH_Controls/HZH_Controls/*.nupkg /HZH_Controls/HZH_Controls/*.nupkg
/HZH_Controls/Help /HZH_Controls/Help
/HZH_Controls/HZH_Controls.sln.GhostDoc.xml /HZH_Controls/HZH_Controls.sln.GhostDoc.xml
/HZH_Controls/.vs/
...@@ -190,7 +190,7 @@ namespace HZH_Controls.Controls ...@@ -190,7 +190,7 @@ namespace HZH_Controls.Controls
{ {
if (m_lstHCache.ContainsKey(control)) if (m_lstHCache.ContainsKey(control))
{ {
if (m_lstHCache[control].Visible) if (m_lstHCache[control].Visible && m_lstHCache[control].Parent != null)
{ {
m_lstHCache[control].Parent.Controls.Remove(m_lstHCache[control]); m_lstHCache[control].Parent.Controls.Remove(m_lstHCache[control]);
} }
...@@ -405,8 +405,9 @@ namespace HZH_Controls.Controls ...@@ -405,8 +405,9 @@ namespace HZH_Controls.Controls
private int GetTreeNodeMaxX(TreeView tv) private int GetTreeNodeMaxX(TreeView tv)
{ {
return tv.Nodes[0].Bounds.Right; return tv.Nodes.Count != 0 ? tv.Nodes[0].Bounds.Right : 0;
} }
void tv_AfterSelect(object sender, TreeViewEventArgs e) void tv_AfterSelect(object sender, TreeViewEventArgs e)
{ {
TreeView tv = (TreeView)sender; TreeView tv = (TreeView)sender;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!