1.默认展开或关闭
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MenuLeft_Load(object sender, EventArgs e)
{
//全部关闭
treeView1.CollapseAll();
//全部展开
//treeView1.ExpandAll();
//某一行展开
//treeView1.Nodes[0].Expand();
}
2.点击某一行跳转页面
private void TreeView1_NodePress(object sender, TreeViewClickEventArgs e)
{
if (e.Nodes.Text == "下线入库")
{
OfflineWarehousing offlineWarehousing = new OfflineWarehousing();
offlineWarehousing.Show(offlineWarehousing);
}
else if (e.Nodes.Text == "手工单入库")
{
ManualInventory manualInventory = new ManualInventory();
manualInventory.Show(manualInventory);
}
}