在TextBox上显示从Combobox选择的文本数据 [英] Display on TextBox From Combobox selected text data
本文介绍了在TextBox上显示从Combobox选择的文本数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将组合框选定的文本数据显示为
TextBox逐行
解决方案
1。更改textBox'Multiline'属性true
2. subscribe Combobox SelectedIndexChanged events
尝试插入此代码
private void comboBox1_SelectedIndexChanged( object sender,EventArgs e)
{
this .textBox1.Text + = Environment.NewLine + this .comboBox1.SelectedItem;
}
private void comboBox1_SelectedIndexChanged( object sender,EventArgs e)
{
textBox1.Text + = comboBox1.SelectedItem .ToString()+ \ n;
}
使用 RichTextBox 或 Multiline TextBox ...
How to show combobox selected text data to
TextBox by line by line
解决方案
1. Change the textBox 'Multiline' property true
2. subscribe Combobox SelectedIndexChanged events
try inserting this code
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { this.textBox1.Text += Environment.NewLine + this.comboBox1.SelectedItem; }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { textBox1.Text += comboBox1.SelectedItem.ToString() + "\n"; }
use RichTextBox or Multiline TextBox...
这篇关于在TextBox上显示从Combobox选择的文本数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文