Hi
1. Here is the code to add a multiline textbox which accepts return,tab.
2. First drag and drop a textbox from the toolbox.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace mltext
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
textBox1.Multiline = true;
//// setting height and width of textbox.
textBox1.Width = 150;
textBox1.Height = 80;
//// Add vertical scroll bars to the TextBox control.
textBox1.ScrollBars = ScrollBars.Vertical;
//// Allow the RETURN key to be entered in the TextBox control.
textBox1.AcceptsReturn = true;
//// Allow the TAB key to be entered in the TextBox control.
textBox1.AcceptsTab = true;
//// Set WordWrap to true to allow text to wrap to the next line.
textBox1.WordWrap = true;
}
}
}
No comments:
Post a Comment