如何做组合框选择的项目更改。 [英] how to do combobox selected item change .
本文介绍了如何做组合框选择的项目更改。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,组合框是datagridview的一个列字段。当我在组合框中选择项时,相应的数据是从数据库显示到datagridview的TextBox列字段...怎么办?
In my application combobox is one column field of datagridview.when i selecting items in combobox corresponding data is display from database in to the TextBox Column Field of datagridview ...how to do?
推荐答案
private void showSelectedButton_Click(object sender, System.EventArgs e) {
int selectedIndex = comboBox1.SelectedIndex;
Object selectedItem = comboBox1.SelectedItem;
MessageBox.Show("Selected Item Text: " + selectedItem.ToString() + "\n" +
"Index: " + selectedIndex.ToString());
}
这篇关于如何做组合框选择的项目更改。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文