TextBox and ListBox : TextBox « GUI Windows Form « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » GUI Windows Form » TextBoxScreenshots 
TextBox and ListBox
TextBox and ListBox


using System;
using System.Drawing;
using System.Windows.Forms;


public class WindowSample : Form
{
   private TextBox data;
   private ListBox results;

   public WindowSample()
   {
      Text = "Sample Window Program";
      Size = new Size(400380);

      Label label1 = new Label();
      label1.Parent = this;
      label1.Text = "Enter text string:";
      label1.AutoSize = true;
      label1.Location = new Point(1010);

      data = new TextBox();
      data.Parent = this;
      data.Size = new Size(200* Font.Height);
      data.Location = new Point(1035);

      results = new ListBox();
      results.Parent = this;
      results.Location = new Point(1065);
      results.Size = new Size(35020 * Font.Height);

      Button checkit = new Button();
      checkit.Parent = this;
      checkit.Text = "test";
      checkit.Location = new Point(235,32);
      checkit.Size = new Size(* Font.Height, * Font.Height);
      checkit.Click += new EventHandler(ButtonOnClick);
   }

   void ButtonOnClick(object obj, EventArgs ea)
   {
      results.Items.Add(data.Text);
      data.Clear();
   }

   public static void Main()
   {
      Application.Run(new WindowSample());
   }
}
           
       
Related examples in the same category
1.Add ScrollBars to TextBox
2.new TextBox(), Localtion, Name, TabIndex, Text
3.TextBox locationTextBox location
4.Keyboard event and TextBox
5.Get value from TextBox
6.Text Changed eventText Changed event
7.A simple text editorA simple text editor
8.Convert TextBox input to double valueConvert TextBox input to double value
9.All cap text textboxAll cap text textbox
10.Data CheckerData Checker
11.User EventsUser Events
12.TextBox and button on formTextBox and button on form
13.Label, TextBox and ButtonLabel, TextBox and Button
14.TextBox DemoTextBox Demo
15.Simple Editor based on TextBox
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.