IPBoxControl 开发手记(二)

    如果哪位发现什么问题和bug,请多多指出,我会及时修改。谢谢!

ExpandedBlockStart.gif ContractedBlock.gif /**/ /*
InBlock.gif * Purpose: IPAddress TextBox Control.
InBlock.gif * Author: Vincent
InBlock.gif * Date: 2004-10-29
InBlock.gif *
ExpandedBlockEnd.gif 
*/

None.gif
None.gif
using  System;
None.gif
using  System.Windows.Forms;
None.gif
None.gif
namespace  Sci.Vincent.Controls
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// <summary>
InBlock.gif    
/// IP Address Box Control.
ExpandedSubBlockEnd.gif    
/// </summary>

InBlock.gif    public class IPBox : System.Windows.Forms.UserControl
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
private System.Windows.Forms.TextBox textBox1;
InBlock.gif        
private System.Windows.Forms.Label label1;
InBlock.gif        
private System.Windows.Forms.Label label2;
InBlock.gif        
private System.Windows.Forms.TextBox textBox2;
InBlock.gif        
private System.Windows.Forms.Label label3;
InBlock.gif        
private System.Windows.Forms.TextBox textBox3;
InBlock.gif        
private System.Windows.Forms.TextBox textBox4;
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// Required designer variable.
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private System.ComponentModel.Container components = null;
InBlock.gif
InBlock.gif        
private System.Windows.Forms.Panel panel1;
InBlock.gif
InBlock.gif        
private const int DEFAULT_WIDTH_SIZE = 136;
InBlock.gif        
private const int DEFAULT_HEIGHT_SIZE = 20;
InBlock.gif        
private string _text = "";
InBlock.gif        
private bool _isAllowWarn = true;
InBlock.gif        
private Languages _language = Languages.English;
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// Usable languages enumeration.
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public enum Languages
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif            
/**//// <summary>
InBlock.gif            
/// English language
ExpandedSubBlockEnd.gif            
/// </summary>

InBlock.gif            English,
ExpandedSubBlockStart.gifContractedSubBlock.gif            
/**//// <summary>
InBlock.gif            
/// Chinese language
ExpandedSubBlockEnd.gif            
/// </summary>

InBlock.gif            Chinese
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// Creates an instance of the IPBox class.
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public IPBox()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
// This call is required by the Windows.Forms Form Designer.
InBlock.gif
            InitializeComponent();
InBlock.gif
InBlock.gif            
// TODO: Add any initialization after the InitComponent call
InBlock.gif

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// Clean up any resources being used.
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected override void Dispose(bool disposing)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if (disposing)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
if (components != null)
InBlock.gif                    components.Dispose();
ExpandedSubBlockEnd.gif            }

InBlock.gif            
base.Dispose(disposing);
ExpandedSubBlockEnd.gif        }

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        
Component Designer generated code#region Component Designer generated code
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// Required method for Designer support - do not modify 
InBlock.gif        
/// the contents of this method with the code editor.
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void InitializeComponent()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
this.textBox1 = new System.Windows.Forms.TextBox();
InBlock.gif            
this.label1 = new System.Windows.Forms.Label();
InBlock.gif            
this.label2 = new System.Windows.Forms.Label();
InBlock.gif            
this.textBox2 = new System.Windows.Forms.TextBox();
InBlock.gif            
this.label3 = new System.Windows.Forms.Label();
InBlock.gif            
this.textBox3 = new System.Windows.Forms.TextBox();
InBlock.gif            
this.textBox4 = new System.Windows.Forms.TextBox();
InBlock.gif            
this.panel1 = new System.Windows.Forms.Panel();
InBlock.gif            
this.panel1.SuspendLayout();
InBlock.gif            
this.SuspendLayout();
InBlock.gif            
// 
InBlock.gif            
// textBox1
InBlock.gif            
// 
InBlock.gif
            this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
InBlock.gif            
this.textBox1.Location = new System.Drawing.Point(80);
InBlock.gif            
this.textBox1.MaxLength = 3;
InBlock.gif            
this.textBox1.Name = "textBox1";
InBlock.gif            
this.textBox1.Size = new System.Drawing.Size(2013);
InBlock.gif            
this.textBox1.TabIndex = 0;
InBlock.gif            
this.textBox1.Text = "";
InBlock.gif            
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
InBlock.gif            
this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
InBlock.gif            
// 
InBlock.gif            
// label1
InBlock.gif            
// 
InBlock.gif
            this.label1.BackColor = System.Drawing.SystemColors.Window;
InBlock.gif            
this.label1.Location = new System.Drawing.Point(320);
InBlock.gif            
this.label1.Name = "label1";
InBlock.gif            
this.label1.Size = new System.Drawing.Size(814);
InBlock.gif            
this.label1.TabIndex = 1;
InBlock.gif            
this.label1.Text = ".";
InBlock.gif            
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
InBlock.gif            
// 
InBlock.gif            
// label2
InBlock.gif            
// 
InBlock.gif
            this.label2.BackColor = System.Drawing.SystemColors.Window;
InBlock.gif            
this.label2.Location = new System.Drawing.Point(640);
InBlock.gif            
this.label2.Name = "label2";
InBlock.gif            
this.label2.Size = new System.Drawing.Size(814);
InBlock.gif            
this.label2.TabIndex = 3;
InBlock.gif            
this.label2.Text = ".";
InBlock.gif            
this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
InBlock.gif            
// 
InBlock.gif            
// textBox2
InBlock.gif            
// 
InBlock.gif
            this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.None;
InBlock.gif            
this.textBox2.Location = new System.Drawing.Point(400);
InBlock.gif            
this.textBox2.MaxLength = 3;
InBlock.gif            
this.textBox2.Name = "textBox2";
InBlock.gif            
this.textBox2.Size = new System.Drawing.Size(2013);
InBlock.gif            
this.textBox2.TabIndex = 2;
InBlock.gif            
this.textBox2.Text = "";
InBlock.gif            
this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
InBlock.gif            
this.textBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox2_KeyPress);
InBlock.gif            
// 
InBlock.gif            
// label3
InBlock.gif            
// 
InBlock.gif
            this.label3.BackColor = System.Drawing.SystemColors.Window;
InBlock.gif            
this.label3.Location = new System.Drawing.Point(960);
InBlock.gif            
this.label3.Name = "label3";
InBlock.gif            
this.label3.Size = new System.Drawing.Size(814);
InBlock.gif            
this.label3.TabIndex = 5;
InBlock.gif            
this.label3.Text = ".";
InBlock.gif            
this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter;
InBlock.gif            
// 
InBlock.gif            
// textBox3
InBlock.gif            
// 
InBlock.gif
            this.textBox3.BorderStyle = System.Windows.Forms.BorderStyle.None;
InBlock.gif            
this.textBox3.Location = new System.Drawing.Point(720);
InBlock.gif            
this.textBox3.MaxLength = 3;
InBlock.gif            
this.textBox3.Name = "textBox3";
InBlock.gif            
this.textBox3.Size = new System.Drawing.Size(2013);
InBlock.gif            
this.textBox3.TabIndex = 4;
InBlock.gif            
this.textBox3.Text = "";
InBlock.gif            
this.textBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
InBlock.gif            
this.textBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox3_KeyPress);
InBlock.gif            
// 
InBlock.gif            
// textBox4
InBlock.gif            
// 
InBlock.gif
            this.textBox4.BorderStyle = System.Windows.Forms.BorderStyle.None;
InBlock.gif            
this.textBox4.Location = new System.Drawing.Point(1040);
InBlock.gif            
this.textBox4.MaxLength = 3;
InBlock.gif            
this.textBox4.Name = "textBox4";
InBlock.gif            
this.textBox4.Size = new System.Drawing.Size(2013);
InBlock.gif            
this.textBox4.TabIndex = 6;
InBlock.gif            
this.textBox4.Text = "";
InBlock.gif            
this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
InBlock.gif            
this.textBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox4_KeyPress);
InBlock.gif            
// 
InBlock.gif            
// panel1
InBlock.gif            
// 
InBlock.gif
            this.panel1.BackColor = System.Drawing.SystemColors.Window;
InBlock.gif            
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
InBlock.gif      &
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值