当我选择Combobox1最后一个值时,将自动选择Combobox2最后一个值 [英] When I Select The Combobox1 Last Value The Combobox2 Last Value Will Be Automatically Selected

查看:97
本文介绍了当我选择Combobox1最后一个值时,将自动选择Combobox2最后一个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个 ComboBoxes 我想存档这样的东西,当我选择 combobox1 最后组合框2 将自动选择最后值,如何使用C#代码存档,请帮助我,

解决方案

  //   SelectionChanges或SelectedIndexChanged  
Combobox1_SelectedIndexChanged(......) )
{
if (Combobox1.SelectedIndex ==(Combobox1.Items.Count -1))
{
Combobox2.SelectedIndex = Combox2.Items.Count - 1 ;
}
}



应该可以工作:)



-KR


I have 2 ComboBoxes I want to archive something like this, When i select the combobox1 last value the combobox2 last value will be automatically selected,How can i archive this using C# Code, please help me,

解决方案

// SelectionChanges or SelectedIndexChanged
Combobox1_SelectedIndexChanged(... ....)
{
    if(Combobox1.SelectedIndex == (Combobox1.Items.Count -1))
    {
        Combobox2.SelectedIndex = Combox2.Items.Count - 1;
    }
}


Should work :)

-KR


这篇关于当我选择Combobox1最后一个值时,将自动选择Combobox2最后一个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆