From 6d3511abe5917aa73a2e98ce2b8c92b120be8521 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期五, 19 九月 2025 15:41:34 +0800
Subject: [PATCH] 增加物料分区
---
DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs b/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs
index 0e5779d..5c20efc 100644
--- a/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcDictionarySelect.cs
@@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data;
+using System.Drawing;
using System.Windows.Forms;
@@ -16,7 +17,7 @@
private List<dynamic> lstCheckedKeyID = new List<dynamic>();//閫夋嫨闆嗗悎
string strTitle = "";
string strWhere = "";
- public UcDictionarySelect(string _strTitle, string _strWhere,string _strMsg="")
+ public UcDictionarySelect(string _strTitle, string _strWhere, string _strMsg = "")
{
InitializeComponent();
@@ -24,12 +25,27 @@
this.strTitle = _strTitle;
this.strWhere = _strWhere;
this.Text = _strTitle;
+ tlMenu.MouseDown += (s, e) =>
+ {
+ TreeListHitInfo hitInfo = tlMenu.CalcHitInfo(new Point(e.X, e.Y));
+ if (hitInfo.HitInfoType == HitInfoType.Cell)
+ {
+ TreeListNode node = hitInfo.Node;
+ if (node != null)
+ {
+ if (node.HasChildren) // 鍙湁褰撹妭鐐规湁瀛愯妭鐐规椂鎵嶈�冭檻灞曞紑鎴栨姌鍙�
+ {
+ if (node.Expanded)
+ node.Collapse();
+ else
+ node.Expand();
+ }
+ }
+ }
+ };
getTree();
tlMenu.CustomDrawNodeCheckBox += TreeList1_CustomDrawNodeCheckBox;
- // tlMenu.OptionsBehavior.Editable = true;
tlMenu.OptionsSelection.EnableAppearanceFocusedCell = false;
- // tlMenu.OptionsSelection.MultiSelect = true;
- // tlMenu.OptionsSelection.MultiSelectMode = TreeListMultiSelectMode.CellSelect;
btnIn.Click += (s, e) =>
{
findOrigin(tlMenu);
@@ -41,7 +57,8 @@
dicCode = key.dicCode,
dicTxt = key.dicTxt
});
- };
+ }
+ ;
UpdateParent?.Invoke(this, new UpdateParentEventArgs { DynamicList = list });
Close();
};
@@ -99,11 +116,11 @@
tlMenu.ParentFieldName = "pid";
tlMenu.Tag = "defectName";
tlMenu.EndUpdate();
- this.tlMenu.CollapseAll();
// tlMenu.OptionsBehavior.Editable = true;
tlMenu.OptionsBehavior.AllowRecursiveNodeChecking = false;
tlMenu.BestFitColumns();
tlMenu.ExpandAll();
+ tlMenu.CollapseAll();
}
catch (Exception ex)
{
--
Gitblit v1.9.3