为您找到"
c# 数组显示在textbox中
"相关结果约100,000,000个
在类成员中写上下两行: private static string ConStr = "Data Source=.;Initial Catalog=数据库名称;Integrated Security=True";SqlConnection con = new SqlConnection(ConStr);在buttonClick事件中写下面代码: try { if (Listbox.Text == ""){ MessageBox.Show("你输入数据为空,请重新输入!"...
string text = textbox.text;SqlDataAdapter da = new SqlDataAdapter("select A,B,C from tablename where D='"+text+"'", connectionString);DataTable dt = new DataTable();da.Fill(dt);ArrayList array = new ArrayList();array.Add(dt.Rows[0][0]);array.Add(dt.Rows[0][1]);...
设置了多行后,高度也要设置啊,把textbox拉高了,才可以正常显示多行。
this.textBox2.Text = textBox1.Text.Substring(0, 3);
应该是调用吧,值是无法引用的,只有对象才可引用。你可先NEW出该类的对象,并将textbox的值赋给该对象的属性,而后即可通过该对象调用该属性,其属性的值便是textbox的值。public class txt { string txt_value="";} 在你想触发的事件中:txt t=new txt();t.txt_value=this.textbox1.text;/...
TextBox1.Focus();你看看 你TextBox1空间 name属性改过没?
你那个会报异常说明输入的字符串格式不正确,比如输入了20122.1.40,或者2012~2~2这种,所以在Convert之前最好先用TryParse试一下看是否能转,转不了的提示用户输入有误。string text = textBox1.Text;DateTime tem;bool isDateTime = DateTime.TryParse(text, out tem);if (isDateTime){ DateTime ...
比如说你的comboBox在 F1中,textBox在F2中 你可以在F1中写一个public static string [] arr 来存放comboBox中的内容,在F2的对象窗体中就可以访问F1.arr了。在F1中 public static arr = new string[comboBox1.Items.Count];for (int i = 0; i < comboBox1.Items.Count;i++){ arr[...
StreamReader sr = File.OpenText("C:\\a.txt");string line = null;while( (line=sr.ReadLine())!=null) //读到内容不为空 { if(string.IsNullOrEmpty(line)) // { int index=line.Length-2; //长度大于2 if (index >= 0)this.textBox1.AppendText(line.Substring(index, 2));//...