110,534
社区成员
发帖
与我相关
我的任务
分享
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 WindowsFormsApplication1
{
public class CboItem
{
public string Text { get; set; }
public string Value { get; set; }
public CboItem(string t, string v)
{
Text = t;
Value = v;
}
public override string ToString()
{
return Text;
}
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
comboBox1.Items.Add(new CboItem("ttt", "vvv"));
}
}
}