Winform文本控件

WPF文本控件,如图
在这里插入图片描述
代码实现

namespace InsertTextW32Target
{
    partial class Target
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.tbTarget = new System.Windows.Forms.TextBox();
            this.rtbTarget = new System.Windows.Forms.RichTextBox();
            this.tbTargetMultiLine = new System.Windows.Forms.TextBox();
            this.lblSingleLineTextBox = new System.Windows.Forms.Label();
            this.lblMultilineTextBox = new System.Windows.Forms.Label();
            this.lblRichTextBox = new System.Windows.Forms.Label();
            this.checkBox1 = new System.Windows.Forms.CheckBox();
            this.checkBox2 = new System.Windows.Forms.CheckBox();
            this.checkBox3 = new System.Windows.Forms.CheckBox();
            this.SuspendLayout();
            // 
            // tbTarget
            // 
            this.tbTarget.AccessibleDescription = "Target TextBox";
            this.tbTarget.AccessibleName = "tbTarget";
            this.tbTarget.AllowDrop = true;
            this.tbTarget.Location = new System.Drawing.Point(119, 223);
            this.tbTarget.MaxLength = 2;
            this.tbTarget.Name = "tbTarget";
            this.tbTarget.Size = new System.Drawing.Size(161, 20);
            this.tbTarget.TabIndex = 0;
            // 
            // rtbTarget
            // 
            this.rtbTarget.AcceptsTab = true;
            this.rtbTarget.AccessibleDescription = "Target RichTextBox";
            this.rtbTarget.AccessibleName = "rtbTarget";
            this.rtbTarget.Location = new System.Drawing.Point(119, 103);
            this.rtbTarget.Name = "rtbTarget";
            this.rtbTarget.Size = new System.Drawing.Size(161, 96);
            this.rtbTarget.TabIndex = 2;
            this.rtbTarget.Text = "";
            // 
            // tbTargetMultiLine
            // 
            this.tbTargetMultiLine.AcceptsReturn = true;
            this.tbTargetMultiLine.AcceptsTab = true;
            this.tbTargetMultiLine.AccessibleDescription = "Target multi-line TextBox";
            this.tbTargetMultiLine.AccessibleName = "mtbTarget";
            this.tbTargetMultiLine.AllowDrop = true;
            this.tbTargetMultiLine.Location = new System.Drawing.Point(119, 12);
            this.tbTargetMultiLine.Multiline = true;
            this.tbTargetMultiLine.Name = "tbTargetMultiLine";
            this.tbTargetMultiLine.Size = new System.Drawing.Size(161, 73);
            this.tbTargetMultiLine.TabIndex = 1;
            this.tbTargetMultiLine.Tag = "test";
            // 
            // lblSingleLineTextBox
            // 
            this.lblSingleLineTextBox.AccessibleDescription = "Label for single line TextBox";
            this.lblSingleLineTextBox.AccessibleName = "lblSingleLineTextBox";
            this.lblSingleLineTextBox.Location = new System.Drawing.Point(12, 223);
            this.lblSingleLineTextBox.Name = "lblSingleLineTextBox";
            this.lblSingleLineTextBox.Size = new System.Drawing.Size(101, 53);
            this.lblSingleLineTextBox.TabIndex = 3;
            this.lblSingleLineTextBox.Text = "Single Line TextBox (2 character limit) (tbTarget)";
            // 
            // lblMultilineTextBox
            // 
            this.lblMultilineTextBox.AccessibleDescription = "Label for multi-line TextBox";
            this.lblMultilineTextBox.AccessibleName = "lblMultiLineTextBox";
            this.lblMultilineTextBox.Location = new System.Drawing.Point(12, 12);
            this.lblMultilineTextBox.Name = "lblMultilineTextBox";
            this.lblMultilineTextBox.Size = new System.Drawing.Size(101, 50);
            this.lblMultilineTextBox.TabIndex = 4;
            this.lblMultilineTextBox.Text = "Multi-Line TextBox (tbTargetMultiLine)";
            // 
            // lblRichTextBox
            // 
            this.lblRichTextBox.AccessibleDescription = "Label for rich text TextBox";
            this.lblRichTextBox.AccessibleName = "lblRichTextBox";
            this.lblRichTextBox.Location = new System.Drawing.Point(12, 103);
            this.lblRichTextBox.Name = "lblRichTextBox";
            this.lblRichTextBox.Size = new System.Drawing.Size(94, 38);
            this.lblRichTextBox.TabIndex = 5;
            this.lblRichTextBox.Text = "RichTextBox (rtbTarget)";
            // 
            // checkBox1
            // 
            this.checkBox1.AutoSize = true;
            this.checkBox1.Location = new System.Drawing.Point(15, 40);
            this.checkBox1.Name = "checkBox1";
            this.checkBox1.Size = new System.Drawing.Size(74, 17);
            this.checkBox1.TabIndex = 8;
            this.checkBox1.Text = "Read-only";
            this.checkBox1.UseVisualStyleBackColor = true;
            this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
            // 
            // checkBox2
            // 
            this.checkBox2.AutoSize = true;
            this.checkBox2.Location = new System.Drawing.Point(15, 132);
            this.checkBox2.Name = "checkBox2";
            this.checkBox2.Size = new System.Drawing.Size(74, 17);
            this.checkBox2.TabIndex = 9;
            this.checkBox2.Text = "Read-only";
            this.checkBox2.UseVisualStyleBackColor = true;
            this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
            // 
            // checkBox3
            // 
            this.checkBox3.AutoSize = true;
            this.checkBox3.Location = new System.Drawing.Point(15, 266);
            this.checkBox3.Name = "checkBox3";
            this.checkBox3.Size = new System.Drawing.Size(74, 17);
            this.checkBox3.TabIndex = 10;
            this.checkBox3.Text = "Read-only";
            this.checkBox3.UseVisualStyleBackColor = true;
            this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
            // 
            // Target
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(292, 312);
            this.Controls.Add(this.checkBox3);
            this.Controls.Add(this.checkBox2);
            this.Controls.Add(this.checkBox1);
            this.Controls.Add(this.lblRichTextBox);
            this.Controls.Add(this.lblMultilineTextBox);
            this.Controls.Add(this.lblSingleLineTextBox);
            this.Controls.Add(this.tbTargetMultiLine);
            this.Controls.Add(this.rtbTarget);
            this.Controls.Add(this.tbTarget);
            this.Name = "Target";
            this.Text = "Target";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.TextBox tbTarget;
        private System.Windows.Forms.RichTextBox rtbTarget;
        private System.Windows.Forms.TextBox tbTargetMultiLine;
        private System.Windows.Forms.Label lblSingleLineTextBox;
        private System.Windows.Forms.Label lblMultilineTextBox;
        private System.Windows.Forms.Label lblRichTextBox;
        private System.Windows.Forms.CheckBox checkBox1;
        private System.Windows.Forms.CheckBox checkBox2;
        private System.Windows.Forms.CheckBox checkBox3;
    }
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

向着光-

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值