Using the TextBox control PDF Print E-mail

Edit boxes are used extensively in Windows programming. This sample uses a TextBox object to fill the entire client area in order to mimick a simple text editor.

  1.  
  2. using System;
  3. using System.Windows.Forms;
  4. class EditSample : Form {
  5. public static void Main() {
  6. Application.Run( new EditSample() );
  7. }
  8. EditSample() {
  9. TextBox t = new TextBox();
  10. t.Multiline = true;
  11. t.Parent = this;
  12. t.Dock = DockStyle.Fill;
  13. }
  14. }
 

We declare a TextBox object and sets its Multiline property to true. Then we assign the Parent and the Dock property of the TextBox object.

The TextBox and RichTextBox classes provides numerous members that satisfy many common needs. The documentation gives all the details.




Bookmark it...
Digg!Reddit!Del.icio.us!Google!Facebook!Slashdot!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!
 
< Prev   Next >
Joomla Template by Joomlashack
Joomla Templates by JoomlaShack Joomla Templates by Compass Design