日期:2009-10-22  浏览次数:20629 次

using System;
using System.Collections;
using System.ComponentModel;

using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Text.RegularExpressions ;

namespace MyWinControl
{
/// <summary>
/// UserControl1 的摘要说明。
/// </summary>
public class lblTextBox : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.ToolTip toolTip1;
private System.ComponentModel.IContainer components;

public lblTextBox()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();

// TODO: 在 InitComponent 调用后添加任何初始化

}

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
components.Dispose();
}
base.Dispose( disposing );
}

#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.label1 = new System.Windows.Forms.Label();
this.splitter1 = new System.Windows.Forms.Splitter();
this.textBox1 = new System.Windows.Forms.TextBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.SuspendLayout();
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Left;
this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 24);
this.label1.TabIndex = 1;
this.label1.Text = "labelText";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// splitter1
//
this.splitter1.Location = new System.Drawing.Point(60, 0);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(24, 24);
this.splitter1.TabIndex = 2;
this.splitter1.TabStop = false;
this.splitter1.Visible = false;
//
// textBox1
//
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Location = new System.Drawing.Point(84, 0);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(116, 21);
this.textBox1.TabIndex = 3;
this.textBox1.Text = "textBox1";
this.textBox1.LostFocus += new System.EventHandler(this.textBox1_LostFocus);
this.textBox1.GotFocus += new System.EventHandler(this.textBox1_GotFocus);
this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// lblTextBox
//
this.Controls.Add(this.textBox1);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.label1);
this.Name = "lblTextBox";
this.Size = new System.Drawing.Size(200, 24);
this.GotFocus += new System.EventHandler(this.lblTextBox_GotFocus);
this.ResumeLayout(false);

}
#endregion

#region//属性
[
Category("Appearance"),
Description("标签的宽度"),
DefaultValue(100),