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
699e1b29
Commit
699e1b29
authored
Jan 05, 2022
by
段廷瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、临时提交
parent
b3442d70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
0 deletions
+80
-0
TextBoxEx.Designer.cs
Tools/MyCommon/controls/TextBoxEx.Designer.cs
+36
-0
TextBoxEx.cs
Tools/MyCommon/controls/TextBoxEx.cs
+38
-0
Tools.csproj
Tools/Tools.csproj
+6
-0
No files found.
Tools/MyCommon/controls/TextBoxEx.Designer.cs
0 → 100644
View file @
699e1b29
namespace
Tools.MyCommon.controls
{
partial
class
TextBoxEx
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private
System
.
ComponentModel
.
IContainer
components
=
null
;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected
override
void
Dispose
(
bool
disposing
)
{
if
(
disposing
&&
(
components
!=
null
))
{
components
.
Dispose
();
}
base
.
Dispose
(
disposing
);
}
#
region
组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private
void
InitializeComponent
()
{
components
=
new
System
.
ComponentModel
.
Container
();
}
#
endregion
}
}
Tools/MyCommon/controls/TextBoxEx.cs
0 → 100644
View file @
699e1b29
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
namespace
Tools.MyCommon.controls
{
/*
* FLAG:重写一个文本框,具备文本着色功能
*/
public
partial
class
TextBoxEx
:
TextBox
{
public
TextBoxEx
()
{
InitializeComponent
();
//绘制样式
this
.
SetStyle
(
ControlStyles
.
UserPaint
//控件将自行绘制,而不是通过操作系统来绘制,重写OnPaint()方法
|
ControlStyles
.
OptimizedDoubleBuffer
//该控件首先在缓冲区中绘制,而不是直接绘制到屏幕上,这样可以减少闪烁
|
ControlStyles
.
AllPaintingInWmPaint
//控件将忽略 WM_ERASEBKGND 窗口消息以减少闪烁
|
ControlStyles
.
ResizeRedraw
//在调整控件大小时重绘控件
|
ControlStyles
.
SupportsTransparentBackColor
//控件接受 alpha 组件小于 255 的 BackColor 以模拟透明
,
true
);
}
protected
override
void
OnPaint
(
PaintEventArgs
e
)
{
base
.
OnPaint
(
e
);
}
}
}
Tools/Tools.csproj
View file @
699e1b29
...
...
@@ -74,6 +74,12 @@
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"MyCommon\controls\TextBoxEx.cs"
>
<SubType>
Component
</SubType>
</Compile>
<Compile
Include=
"MyCommon\controls\TextBoxEx.Designer.cs"
>
<DependentUpon>
TextBoxEx.cs
</DependentUpon>
</Compile>
<Compile
Include=
"MyCommon\Log.cs"
/>
<Compile
Include=
"MyCommon\UserLog.cs"
/>
<Compile
Include=
"MyCommon\controls\MyTreeView.cs"
>
...
...
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