C# 怎么样按button 向下到底,后循环回去第一个

if(skinListBox1.Items.Count==0)
{

}
else
{
if (skinListBox1.SelectedIndex == 0)
{
skinListBox1.SelectedIndex = skinListBox1.Items.Count - 1;
}
else
{
skinListBox1.SelectedIndex++;
}
}

if (skinListBox1.SelectedIndex == 0)
{
    for(int i=0;i<skinListBox1.Items.Count;i++)
    {
        skinListBox1.SelectedIndex=i;
    }
    skinListBox1.SelectedIndex=0;
}
else
{
skinListBox1.SelectedIndex=0;
}//这个是循环开始必须从第一个,不是则自动跳到第一个

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答