请问这个代码应写在什么事件里?在线等
请问这个代码应写在什么事件里?
if (listBox1.SelectedIndex == -1)
             {
                 button4.Enabled = false;
             }
             else
             {
                 button4.Enabled = true;
             }
另外,form-actived事件处理什么好呢?
------解决方案--------------------
写在listbox 的SelectedIndexChanged事件中
FormActived 时间用来处理当前窗口是活动的,也就是标题栏从灰色变为蓝色的时候激发的