Checklist框中的SelectedIndexChanging事件在哪里? [英] Where is SelectedIndexChanging Event in Check listbox?

查看:66
本文介绍了Checklist框中的SelectedIndexChanging事件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我似乎在Windows窗体控件检查列表"中找不到SelectedIndexChanging事件.有什么方法可以在selectedIndexChanged之前获取事件或告诉以前的选定索引是什么?

感谢

Hi,

I can''t seem to find the SelectedIndexChanging event on Windows form control Check Listbox. Is there any way to get the event before the selectedIndexChanged or tell what the previous selected index was?

Thanks

推荐答案

我所拥有的是存储在复选框列表中的证书列表,用户可以为每个证书选择特定的开始日期或结束日期.现在,当用户离开该特定文本框时,我想检查它是否已被选中,然后保存该证书和开始/结束日期.如果那有道理.

也许我应该弹出一个新窗口,提示用户输入开始日期和结束日期?
Well what I have is a list of certificates stored in a check list box, for each certificate the user can select a specific Start or End Date. Now when the user leaves that specifc text box I would like to check if it has been checked and then save that certificate and Start/End date. If that makes sence.

Maybe I should just pop a new windows which promps the user for a Start and End Date?


嗨 巴迪,

请使用以下代码:

Hi Bardy,

Please you can use following code:

private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (e.NewValue == CheckState.Checked)
            {
                //You can save the selected item into databse
                //Yor Popup should comes here...
                MessageBox.Show("Selected item is: " + checkedListBox1.Text);
            }
            else
            {
                //you can remove the item from database
            }
        }



如有任何疑问,请让我知道.

如果对您有帮助,请提供投票.

谢谢,
Imdadhusen



Please do let me know, if you have any doubt.

Please provide Vote if this would be helpful to you.

Thanks,
Imdadhusen


这篇关于Checklist框中的SelectedIndexChanging事件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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