資源簡介
下拉框綁定數據顯示名稱對應相關值,比如下拉框顯示是中文城市名,實際的數據是城市的拼音。
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
namespace?WindowsFormsApplication3
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?comboBox1_SelectedIndexChanged(object?sender?EventArgs?e)
????????{
????????????richTextBox1.Text?=?comboBox1.SelectedValue.ToString();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????//需放在Load處;
????????????//下拉框綁定數據需添加指令集using?System.Data;
????????????DataTable?dt?=?new?DataTable();
????????????DataColumn?column;
????????????DataRow?row;
????????????co
- 上一篇:C#與歐姆龍通訊手冊.pdf
- 下一篇:C#數據庫中讀取圖片示例
評論
共有 條評論