0

我试图弄清楚如何设置我的代码,以便在组合框中选择一个选项时,它也会更改标签的文本。据我了解,它涉及一个称为项目侦听器的东西,但我们在课堂上没有讨论任何关于它的内容。我们最近讨论了继承和接口,但我不知道这将如何应用在这里。

4

1 回答 1

0
//this event is fired whenever user selects or change a item from combobox

private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
{

    //do whatever you want to do in this
}

 for android do this

  spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
    @Override
    public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
        // your code here
    }

    @Override
    public void onNothingSelected(AdapterView<?> parentView) {
        // your code here
    }

});
于 2013-11-14T07:32:22.723 回答