界面上放一个combox,3个按钮,分别叫btnUp, btnDown, btnconfirm private void btnUp_Click(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex <=0)
return;
comboBox1.SelectedIndex = comboBox1.SelectedIndex -1;
} private void btnDown_Click(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex >= comboBox1.Items.Count - 1)
return;
comboBox1.SelectedIndex =comboBox1.SelectedIndex +1;
} private void btnConfirm_Click(object sender, EventArgs e)
{
MessageBox.Show(comboBox1.Text);
}