Commit 699e1b29 authored by 段廷瑞's avatar 段廷瑞

1、临时提交

parent b3442d70
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
}
}
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);
}
}
}
......@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment