当前位置: 首页>>代码示例>>C#>>正文


C# Forms.TextBox类代码示例

本文整理汇总了C#中System.Windows.Forms.TextBox的典型用法代码示例。如果您正苦于以下问题:C# TextBox类的具体用法?C# TextBox怎么用?C# TextBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TextBox类属于System.Windows.Forms命名空间,在下文中一共展示了TextBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeSettings

        public ChangeSettings()
        {
            InitializeComponent();

            for (int i = 0; i < Types.Length; i++)
            {
                if (Types[i] != typeof(bool))
                {
                    TextBox tb = new TextBox();
                    tb.Text = set[Names[i, 0]].ToString();
                    tb.Size = new Size(100, lineDist);
                    tb.Location = new Point(185, i * (lineDist + 5) + 20);
                    Controls.Add(tb);
                    controlList.Add(tb);
                    toolTip1.SetToolTip(tb, Names[i, 2]);
                }
                else
                {
                    CheckBox cb = new CheckBox();
                    cb.Checked = (bool)set[Names[i, 0]];
                    cb.Location = new Point(185, i * (lineDist + 5) + 20);
                    Controls.Add(cb);
                    controlList.Add(cb);
                    toolTip1.SetToolTip(cb, Names[i, 2]);
                }

                Label l = new Label();
                l.Text = Names[i, 1];
                l.AutoSize = true;
                l.Location = new Point(180 - TextRenderer.MeasureText(l.Text, new Font(l.Font.FontFamily, l.Font.Size, l.Font.Style)).Width, i * (lineDist + 5) + 20);
                Controls.Add(l);
                toolTip1.SetToolTip(l, Names[i, 2]);
            }
        }
开发者ID:c37-cae,项目名称:GrblHeightProbe2,代码行数:34,代码来源:ChangeSettings.cs

示例2: BuildDirPanel

		protected TextBox BuildDirPanel(Control parent, String name)
		{
			Panel panel = new Panel();
			panel.Dock = DockStyle.Top;
			panel.Height = 60;

			Label l = new Label();
			l.Location = new Point(0, 0);
			l.Dock = DockStyle.Left;
			l.Text = name;
			l.AutoSize = true;
			panel.Controls.Add(l);

			TextBox textBox = new TextBox();
			textBox.Location = new Point(10, 20);
			textBox.Width = ((ICustPanel)this).PreferredSize.Width - 40;
			panel.Controls.Add(textBox);
			
			// Don't have a reasonable directory browser and don't feel
			// like doing the P/Invoke for the underlying one.  Sigh.
			/*****
			Button b = new Button();
			b.Location = new Point(120, 20);
			b.Width = 20;
			b.Text = "...";
			b.Tag = textBox;
			b.Click += new EventHandler(DirButtonClicked);
			panel.Controls.Add(b);
			*****/
			
			parent.Controls.Add(panel);
			
			return textBox;
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:34,代码来源:CustDirPanel.cs

示例3: buildGui

    	public void buildGui()
    	{
    		var topPanel = this.add_Panel();
    		Path = topPanel.insert_Above<TextBox>(20);
			sourceCode = topPanel.add_SourceCodeEditor();
			dataGridView = sourceCode.insert_Above<Panel>(100).add_DataGridView();
			leftPanel = topPanel.insert_Left<Panel>(300);									
			
			Path.onEnter(loadFiles);
			Path.onDrop(
				(fileOrFolder)=>{
									Path.set_Text(fileOrFolder);
									loadFiles(fileOrFolder);
								}); 	   	   	   	   
			dataGridView.SelectionChanged+= 
				(sender,e) => {
						if (dataGridView.SelectedRows.size() == 1)
						{
							var selectedRow = dataGridView.SelectedRows[0]; 
							var filePath = selectedRow.Cells[0].Value.str();
							var filename = selectedRow.Cells[1].Value.str();
							var lineNumber = selectedRow.Cells[2].Value.str();
							"opening up source code: {0}".info(filePath);
							sourceCode.open(filePath.pathCombine(filename));  
							sourceCode.gotoLine(lineNumber.toInt() + 1);
							dataGridView.focus();
						}
				  };
								
		}
开发者ID:SiGhTfOrbACQ,项目名称:O2.Platform.Scripts,代码行数:30,代码来源:ascx_SimpleFileSearch.cs

示例4: InitializeComponent

 private void InitializeComponent()
 {
     this.tbxPrintName = new System.Windows.Forms.TextBox();
     this.label1 = new System.Windows.Forms.Label();
     base.SuspendLayout();
     this.tbxPrintName.set_Location(new System.Drawing.Point(0x4c, 12));
     this.tbxPrintName.set_Margin(new System.Windows.Forms.Padding(4, 4, 4, 4));
     this.tbxPrintName.set_Name("tbxPrintName");
     this.tbxPrintName.set_Size(new System.Drawing.Size(0x1bd, 0x16));
     this.tbxPrintName.set_TabIndex(0);
     this.label1.set_AutoSize(true);
     this.label1.set_Location(new System.Drawing.Point(13, 0x12));
     this.label1.set_Margin(new System.Windows.Forms.Padding(4, 0, 4, 0));
     this.label1.set_Name("label1");
     this.label1.set_Size(new System.Drawing.Size(0x27, 0x10));
     this.label1.set_TabIndex(1);
     this.label1.set_Text("ФИО");
     base.set_AutoScaleDimensions(new System.Drawing.SizeF(8f, 16f));
     base.set_AutoScaleMode(System.Windows.Forms.AutoScaleMode.Font);
     base.set_ClientSize(new System.Drawing.Size(0x213, 0x1cf));
     base.Controls.Add(this.label1);
     base.Controls.Add(this.tbxPrintName);
     this.set_Font(new System.Drawing.Font("Microsoft Sans Serif", 9.75f));
     base.set_Margin(new System.Windows.Forms.Padding(4, 4, 4, 4));
     base.set_Name("AddBenefitResident");
     this.set_Text("AddBenefitResident");
     base.add_Load(new System.EventHandler(this.AddBenefitResident_Load));
     base.ResumeLayout(false);
     base.PerformLayout();
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:30,代码来源:AddBenefitResident.cs

示例5: ProjectReferencePanel

        public ProjectReferencePanel(ISelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            ColumnHeader nameHeader = new ColumnHeader();
            nameHeader.Text  = ResourceService.GetString("Dialog.SelectReferenceDialog.ProjectReferencePanel.NameHeader");
            nameHeader.Width = 170;
            Columns.Add(nameHeader);

            ColumnHeader directoryHeader = new ColumnHeader();
            directoryHeader.Text  = ResourceService.GetString("Dialog.SelectReferenceDialog.ProjectReferencePanel.DirectoryHeader");
            directoryHeader.Width = 290;
            Columns.Add(directoryHeader);

            View = View.Details;
            Dock = DockStyle.Fill;
            FullRowSelect = true;

            ItemActivate += delegate { AddReference(); };
            PopulateListView();

            Panel upperPanel = new Panel { Dock = DockStyle.Top, Height = 20 };
            filterTextBox = new TextBox { Width = 150, Dock = DockStyle.Right };
            filterTextBox.TextChanged += delegate { Search(); };

            upperPanel.Controls.Add(filterTextBox);

            this.Controls.Add(upperPanel);
        }
开发者ID:fanyjie,项目名称:SharpDevelop,代码行数:29,代码来源:ProjectReferencePanel.cs

示例6: InitializeComponent

 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Labelled));
     this.groupBox1 = new GroupBox();
     this.textBox1 = new TextBox();
     this.groupBox1.SuspendLayout();
     base.SuspendLayout();
     this.groupBox1.Controls.Add(this.textBox1);
     this.groupBox1.Location = new Point(13, 10);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new Size(0x128, 0x189);
     this.groupBox1.TabIndex = 0;
     this.groupBox1.TabStop = false;
     this.groupBox1.Text = "标签说明:";
     this.textBox1.Location = new Point(7, 0x15);
     this.textBox1.Multiline = true;
     this.textBox1.Name = "textBox1";
     this.textBox1.Size = new Size(0x11b, 0x162);
     this.textBox1.TabIndex = 0;
     this.textBox1.Text = resources.GetString("textBox1.Text");
     base.AutoScaleDimensions = new SizeF(6f, 12f);
     base.AutoScaleMode = AutoScaleMode.Font;
     base.ClientSize = new Size(0x141, 0x199);
     base.Controls.Add(this.groupBox1);
     base.FormBorderStyle = FormBorderStyle.FixedDialog;
     base.MaximizeBox = false;
     base.MinimizeBox = false;
     base.Name = "Labelled";
     base.StartPosition = FormStartPosition.CenterScreen;
     this.Text = "Labelled";
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     base.ResumeLayout(false);
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:34,代码来源:Labelled.cs

示例7: Main

        static void Main(string[] args)
        {
            int n = 4;

            int[] nizBrojeva;  // deklaracija reference na niz

            // TODO: nizBrojeva inicijalizirati kao niz duljine n (pojedine èlanove ostaviti neinicijaliziranima) te ispisati sve èlanove takvog neinicijaliziranog niza




            Control[] nizKontrola;  // deklaracija reference na niz 

            // TODO: nizKontrola inicijalizirati kao niz duljine n (pojedine èlanove ostaviti neinicijaliziranima) te ispisati sve èlanove takvog neinicijaliziranog niza




            // TODO: Pokrenuti program te ispis prekopirati u datoteku "InicijalizacijaNiza.txt" u ovom projektu. Obrazložiti ispise u gornja dva sluèaja.

            // inicijalizacija pojedinih èlanova
            nizKontrola[0] = new Button();
            nizKontrola[1] = new Form();
            nizKontrola[2] = nizKontrola[0];
            nizKontrola[3] = new TextBox();

            for (int i = 0; i < n; ++i)
            {
                Console.WriteLine(string.Format("{0}. kontrola: {1}", i, nizKontrola[i]));
            }

            Console.WriteLine("GOTOVO!!!");
            Console.ReadKey();
        }
开发者ID:vsite-csharp,项目名称:14-Nizovi,代码行数:34,代码来源:InicijalizacijaNiza.cs

示例8: FindGolfIdDialog

 public FindGolfIdDialog(ref TextBox tb)
 {
     this.tb = tb;
     InitializeComponent();
     golfId_textBox.Text = this.tb.Text;
     UpdateTable();
 }
开发者ID:emeliehareland,项目名称:Golf,代码行数:7,代码来源:FindGolfIdDialog.cs

示例9: Checking_TextBox

 /// <summary>
 /// Та же самая проверка только массивом
 /// </summary>
 /// <param name="_textBox"></param>
 /// <param name="_message"></param>
 /// <returns></returns>
 public static bool Checking_TextBox(TextBox[] _textBox , String[] _message)
 {
     for ( int i = 0; i < _textBox.Length; i++ )
         if ( !Checking_TextBox( _textBox[i] , _message[i] ) )   //Если хоть один false то нет смысла проверять остальные
             return false;
     return true;
 }
开发者ID:simple-testing,项目名称:student-testing,代码行数:13,代码来源:FormsUtility.cs

示例10: InitialiseComponent

        private void InitialiseComponent()
        {
            this.OKButton = new Button();
            this.CancelButton = new Button();
            this.UserInput = new TextBox();

            //Form Properties
            this.Size = new System.Drawing.Size(280, 160);

            //OKButton Properties
            this.OKButton.Location = new System.Drawing.Point(10, 60);
            this.OKButton.Size = new System.Drawing.Size(120, 20);
            this.OKButton.Click += new EventHandler(OKButtonClicked);
            this.OKButton.Enabled = false; //unclickable until user inputs string in the search field
            this.OKButton.Text = "Retrieve WebPage";

            //CancelButton Properties
            this.CancelButton.Location = new System.Drawing.Point(140, 60);
            this.CancelButton.Size = new System.Drawing.Size(120,20);
            this.CancelButton.Click+= new EventHandler(CancelButtonClicked);
            this.CancelButton.Text = "Cancel";

            //UserInput Properties
            this.UserInput.Location = new System.Drawing.Point(0,0);//10,25
            this.UserInput.TextChanged+=new EventHandler(UserInputTextChanged);
            this.UserInput.Size = new System.Drawing.Size(230, 10);

            //Controls
            this.Controls.AddRange(new Control[] { this.OKButton, this.CancelButton, this.UserInput });
        }
开发者ID:eklavyamirani,项目名称:WordNote,代码行数:30,代码来源:DialogBox.cs

示例11: TUC_AccountsListFilterFind

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="AFilterFindPanelObject">The FilterFindPanel Object on the main form</param>
        /// <param name="ASuspenseAccountsAllowed">Used to determine if the suspense accounts control be shown.</param>
        public TUC_AccountsListFilterFind(TFilterAndFindPanel AFilterFindPanelObject, bool ASuspenseAccountsAllowed)
        {
            FSuspenseAccountsAllowed = ASuspenseAccountsAllowed;

            FFilterTxtAccountCode = (TextBox)AFilterFindPanelObject.FilterPanelControls.FindControlByName("txtAccountCode");
            FFilterCmbAccountType = (TCmbAutoComplete)AFilterFindPanelObject.FilterPanelControls.FindControlByName("cmbAccountType");
            FFilterTxtDescrEnglish = (TextBox)AFilterFindPanelObject.FilterPanelControls.FindControlByName("txtDescrEnglish");
            FFilterTxtDescrLocal = (TextBox)AFilterFindPanelObject.FilterPanelControls.FindControlByName("txtDescrLocal");
            FFilterChkBankAccount = (CheckBox)AFilterFindPanelObject.FilterPanelControls.FindControlByName("chkBankAccount");

            if (ASuspenseAccountsAllowed)
            {
                FFilterChkSuspenseAccount = (CheckBox)AFilterFindPanelObject.FilterPanelControls.FindControlByName("chkSuspenseAccount");
            }

            FFilterChkActive = (CheckBox)AFilterFindPanelObject.FilterPanelControls.FindControlByName("chkActive");
            FFilterChkSummary = (CheckBox)AFilterFindPanelObject.FilterPanelControls.FindControlByName("chkSummary");
            FFilterChkForeign = (CheckBox)AFilterFindPanelObject.FilterPanelControls.FindControlByName("chkForeign");

            FFindTxtAccountCode = (TextBox)AFilterFindPanelObject.FindPanelControls.FindControlByName("txtAccountCode");
            FFindCmbAccountType = (TCmbAutoComplete)AFilterFindPanelObject.FindPanelControls.FindControlByName("cmbAccountType");
            FFindTxtDescrEnglish = (TextBox)AFilterFindPanelObject.FindPanelControls.FindControlByName("txtDescrEnglish");
            FFindTxtDescrLocal = (TextBox)AFilterFindPanelObject.FindPanelControls.FindControlByName("txtDescrLocal");
            FFindChkBankAccount = (CheckBox)AFilterFindPanelObject.FindPanelControls.FindControlByName("chkBankAccount");

            if (ASuspenseAccountsAllowed)
            {
                FFindChkSuspenseAccount = (CheckBox)AFilterFindPanelObject.FindPanelControls.FindControlByName("chkSuspenseAccount");
            }

            FFindChkActive = (CheckBox)AFilterFindPanelObject.FindPanelControls.FindControlByName("chkActive");
            FFindChkSummary = (CheckBox)AFilterFindPanelObject.FindPanelControls.FindControlByName("chkSummary");
            FFindChkForeign = (CheckBox)AFilterFindPanelObject.FindPanelControls.FindControlByName("chkForeign");
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:39,代码来源:UC_AccountsList.FilterFind.ManualCode.cs

示例12: CustomListBoxTextEditor

 internal CustomListBoxTextEditor(CustomListBox listBox, TextBox textBox)
 {
     _listBox = listBox;
     _textBox = textBox;
     _textBox.Validating += OnValidating;
     _textBox.KeyDown += OnKeyDown;
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:7,代码来源:CustomListBoxTextEditor.cs

示例13: InitializeComponent

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.txtLine = new System.Windows.Forms.TextBox();
			this.btnOK = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(24, 18);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(72, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "Line Number";
			// 
			// txtLine
			// 
			this.txtLine.Location = new System.Drawing.Point(104, 16);
			this.txtLine.Name = "txtLine";
			this.txtLine.Size = new System.Drawing.Size(112, 20);
			this.txtLine.TabIndex = 1;
			this.txtLine.Text = "";
			// 
			// btnOK
			// 
			this.btnOK.Location = new System.Drawing.Point(240, 16);
			this.btnOK.Name = "btnOK";
			this.btnOK.TabIndex = 2;
			this.btnOK.Text = "&OK";
			this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
			// 
			// btnCancel
			// 
			this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnCancel.Location = new System.Drawing.Point(240, 48);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.TabIndex = 3;
			this.btnCancel.Text = "&Cancel";
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// Goto
			// 
			this.AcceptButton = this.btnOK;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.CancelButton = this.btnCancel;
			this.ClientSize = new System.Drawing.Size(338, 87);
			this.Controls.Add(this.btnCancel);
			this.Controls.Add(this.btnOK);
			this.Controls.Add(this.txtLine);
			this.Controls.Add(this.label1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "Goto";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "Go To";
			this.ResumeLayout(false);

		}
开发者ID:nguyenhuuhuy,项目名称:mygeneration,代码行数:64,代码来源:Goto.cs

示例14: InitializeComponent

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.textBoxOutput = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// textBoxOutput
			// 
			this.textBoxOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.textBoxOutput.Location = new System.Drawing.Point(8, 8);
			this.textBoxOutput.Multiline = true;
			this.textBoxOutput.Name = "textBoxOutput";
			this.textBoxOutput.ScrollBars = System.Windows.Forms.ScrollBars.Both;
			this.textBoxOutput.Size = new System.Drawing.Size(832, 552);
			this.textBoxOutput.TabIndex = 0;
			this.textBoxOutput.Text = "";
			this.textBoxOutput.WordWrap = false;
			// 
			// SimpleOutputForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(848, 566);
			this.Controls.Add(this.textBoxOutput);
			this.Name = "SimpleOutputForm";
			this.Text = "SimpleOutputForm";
			this.ResumeLayout(false);

		}
开发者ID:nguyenhuuhuy,项目名称:mygeneration,代码行数:33,代码来源:SimpleOutputForm.cs

示例15: VendingDisplayController

 public VendingDisplayController(TextBox displayTextBox, ICoinPurse coinPurse)
 {
     Display = displayTextBox;
     CoinPurse = coinPurse;
     CoinPurse.RegisterObserver(this);
     DisplayMessage(IntialMessage);
 }
开发者ID:robbell5,项目名称:Vending-Machine-Kata,代码行数:7,代码来源:VendingDisplayController.cs


注:本文中的System.Windows.Forms.TextBox类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。