using System;
using System.Collections.Generic;
using System.Text;
namespace Interventi.Client
{
public class clscombo
{
public string Name;
public int ReferenceID;
public void Add(string name, int referenceID)
{
this.Name = name; this.ReferenceID = referenceID;
}
public override string ToString()
{
return this.Name;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Interventi.Client.Forms
{
public partial class frmComuni : Form
{
public frmComuni()
{
InitializeComponent();
}
private void toolStripButton7_Click(object sender, EventArgs e)
{
this.Hide();
}
private void frmComuni_Load(object sender, EventArgs e)
{
cmbParametri.Items.Add(new clscombo("popo", 3));
cmbParametri.SelectedIndex = 0;
}
private void cmbParametri_OnSelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = String.Format("{0}", ((clscombo)cmbParametri.SelectedItem).ReferenceID);
}
}
}