Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Ftt_Common
Commits
27316c1c
Commit
27316c1c
authored
May 22, 2026
by
段廷瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref: 回车触发搜索如果没有结果,则给出提示
parent
ed4a45df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
4 deletions
+48
-4
Utils.cs
Tools/MyUtils/Utils.cs
+34
-0
wAutoClass.cs
Tools/UI/wAutoClass.cs
+3
-0
wDBTableDevelopTools.cs
Tools/UI/wDBTableDevelopTools.cs
+1
-1
wModuleManager.cs
Tools/UI/wModuleManager.cs
+10
-3
No files found.
Tools/MyUtils/Utils.cs
View file @
27316c1c
...
@@ -5,6 +5,7 @@ using System.Collections.Generic;
...
@@ -5,6 +5,7 @@ using System.Collections.Generic;
using
System.Configuration
;
using
System.Configuration
;
using
System.Data
;
using
System.Data
;
using
System.Diagnostics
;
using
System.Diagnostics
;
using
System.Drawing
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Security.Cryptography
;
using
System.Security.Cryptography
;
...
@@ -460,6 +461,39 @@ namespace Tools.MyUtils
...
@@ -460,6 +461,39 @@ namespace Tools.MyUtils
new
wMsgBox
().
Show
(
msg
,
width
,
height
);
new
wMsgBox
().
Show
(
msg
,
width
,
height
);
}
}
/// <summary>
/// <summary>
/// Toast提示(自动关闭)
/// </summary>
/// <param name="msg">消息</param>
/// <param name="durationMs">显示时长(毫秒),默认2秒</param>
public
static
void
Toast
(
string
msg
,
int
durationMs
=
2000
)
{
var
timer
=
new
System
.
Windows
.
Forms
.
Timer
{
Interval
=
durationMs
};
var
form
=
new
Form
{
FormBorderStyle
=
FormBorderStyle
.
None
,
StartPosition
=
FormStartPosition
.
CenterScreen
,
BackColor
=
Color
.
FromArgb
(
255
,
255
,
225
),
Size
=
new
Size
(
250
,
50
),
TopMost
=
true
,
ShowInTaskbar
=
false
,
};
form
.
Controls
.
Add
(
new
Label
{
Text
=
msg
,
Dock
=
DockStyle
.
Fill
,
TextAlign
=
ContentAlignment
.
MiddleCenter
,
Font
=
new
Font
(
"微软雅黑"
,
9F
),
});
timer
.
Tick
+=
(
s
,
e
)
=>
{
timer
.
Stop
();
form
.
Close
();
timer
.
Dispose
();
};
timer
.
Start
();
form
.
Show
();
}
/// <summary>
/// 是否提示
/// 是否提示
/// </summary>
/// </summary>
/// <param name="msg"></param>
/// <param name="msg"></param>
...
...
Tools/UI/wAutoClass.cs
View file @
27316c1c
...
@@ -69,6 +69,9 @@ namespace Tools.UI
...
@@ -69,6 +69,9 @@ namespace Tools.UI
return
;
return
;
this
.
RefrashData
(
false
);
this
.
RefrashData
(
false
);
if
(
lsbTableInfo
.
Items
.
Count
==
0
)
Utils
.
Toast
(
"未找到匹配结果"
);
}
}
}
}
...
...
Tools/UI/wDBTableDevelopTools.cs
View file @
27316c1c
...
@@ -1208,7 +1208,7 @@ namespace Tools.UI
...
@@ -1208,7 +1208,7 @@ namespace Tools.UI
}
}
else
else
{
{
Utils
.
T
ip
(
notFoundMessage
);
Utils
.
T
oast
(
notFoundMessage
);
}
}
}
}
#
endregion
#
endregion
...
...
Tools/UI/wModuleManager.cs
View file @
27316c1c
...
@@ -213,7 +213,8 @@ namespace Tools.UI
...
@@ -213,7 +213,8 @@ namespace Tools.UI
{
{
if
(
e
.
KeyCode
==
Keys
.
Enter
)
if
(
e
.
KeyCode
==
Keys
.
Enter
)
{
{
this
.
SetTreeNodeBackColor
(
this
.
myTreeView1
.
Nodes
,
this
.
tbSearch
.
Text
.
Trim
());
if
(!
this
.
SetTreeNodeBackColor
(
this
.
myTreeView1
.
Nodes
,
this
.
tbSearch
.
Text
.
Trim
()))
Utils
.
Toast
(
"未找到匹配结果"
);
}
}
}
}
/// <summary>
/// <summary>
...
@@ -221,13 +222,17 @@ namespace Tools.UI
...
@@ -221,13 +222,17 @@ namespace Tools.UI
/// </summary>
/// </summary>
/// <param name="nodes">树节点</param>
/// <param name="nodes">树节点</param>
/// <param name="SearchText">查询字串</param>
/// <param name="SearchText">查询字串</param>
private
void
SetTreeNodeBackColor
(
TreeNodeCollection
nodes
,
string
SearchText
)
/// <returns>是否找到匹配项</returns>
private
bool
SetTreeNodeBackColor
(
TreeNodeCollection
nodes
,
string
SearchText
)
{
{
bool
found
=
false
;
foreach
(
TreeNode
n
in
nodes
)
foreach
(
TreeNode
n
in
nodes
)
{
{
//查询条件不为空并且包含查询字符,则设置背景色
//查询条件不为空并且包含查询字符,则设置背景色
bool
IsSearched
=
!
string
.
IsNullOrEmpty
(
SearchText
)
&&
n
.
Text
.
Contains
(
SearchText
);
bool
IsSearched
=
!
string
.
IsNullOrEmpty
(
SearchText
)
&&
n
.
Text
.
Contains
(
SearchText
);
n
.
BackColor
=
IsSearched
?
Color
.
LightBlue
:
Color
.
White
;
n
.
BackColor
=
IsSearched
?
Color
.
LightBlue
:
Color
.
White
;
if
(
IsSearched
)
found
=
true
;
#
region
节点展开与折叠
#
region
节点展开与折叠
if
(
IsSearched
)
if
(
IsSearched
)
...
@@ -245,8 +250,10 @@ namespace Tools.UI
...
@@ -245,8 +250,10 @@ namespace Tools.UI
#
endregion
#
endregion
//递归子节点
//递归子节点
this
.
SetTreeNodeBackColor
(
n
.
Nodes
,
SearchText
);
if
(
this
.
SetTreeNodeBackColor
(
n
.
Nodes
,
SearchText
))
found
=
true
;
}
}
return
found
;
}
}
/// <summary>
/// <summary>
/// 展开查询节点的父节点
/// 展开查询节点的父节点
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment