//StringIntObject.cs
using System;
namespace TestUI_PCGL
{
/// <summary>
/// StringIntObject 的摘要说明。
/// </summary>
public class StringIntObject
{
public string s;
public int i;
public StringIntObject(string sz, int n)
{
s=sz;
i=n;
}
public override string ToString()
{
return s;
}
}
}
//MainForm.cs
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Threading;
using System.Collections.Specialized;
using System.Runtime.Remoting.Messaging;
using System.Text.RegularExpressions;
using TestUI_PCGL;
namespace TestUI_PCGL
{
private void BindComb_cb_shzt()
{
StringIntObject[] a=new StringIntObject[5];
a[0]=new StringIntObject("编辑:0",0);
a[1]=new StringIntObject("区域经理审核:6",6);
a[2]=new StringIntObject("大区审核:1",1);
a[3]=new StringIntObject("业务分部审核:2",2);
a[4]=new StringIntObject("预测室审核:3",3);
this.cb_shzt.Items.AddRange(a);
this.cb_shzt.SelectedIndex=0;
}
private void cb_shzt_SelectedIndexChanged(object sender, System.EventArgs e)
{
MessageBox.Show(((StringIntObject)this.cb_shzt.SelectedItem).i+"");
}
}