纳速健身
标题:
读取listbox中选中的多行的值
[打印本页]
作者:
yaokai
时间:
2009-8-17 10:29
标题:
读取listbox中选中的多行的值
private void btnInsert_Click(object sender, EventArgs e)
{
lstColumns.ValueMember = "Field";
for (int i = 0; i < lstColumns.SelectedIndices.Count; i++)
{
string strQuery = "," + ((DataRowView)(lstColumns.SelectedItems
)).Row["Field"].ToString();
if (txtQuery.Text.ToString() == null || txtQuery.Text.Trim() == "")
{
txtQuery.Text = strQuery.Substring(1);
}
else
{
txtQuery.Text = txtQuery.Text.ToString() + " " + strQuery.ToString();
}
}
}
已经经过实践检验,哈哈
欢迎光临 纳速健身 (https://nasue.com/)
Powered by Discuz! X3.4