private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = "可以輸入多行";
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Multiline = true;//允許多行屬性
//置換換行符號為空白,讓messagebox秀出輸入的字串
String a = textBox1.Text;
a = a.Replace("\r\n", "");
a = a.Replace("\n", "");
a = a.Replace("\r", "");
MessageBox.Show(a);
}
沒有留言:
張貼留言