编码 前进、后退 按钮状态
编码 前进、后退 按钮状态
代码
private int _current = 0;
private int _min = 0;
private int _max = 99;
private void SetBtn_NextORPrevious_State()
{
btnNext.Enabled = btnPre.Enabled = true;
if (_current == _min)
btnPre.Enabled = false;
if (_current == _max)
btnNext.Enabled = false;
}
private int _current = 0;
private int _min = 0;
private int _max = 99;
private void SetBtn_NextORPrevious_State()
{
btnNext.Enabled = btnPre.Enabled = true;
if (_current == _min)
btnPre.Enabled = false;
if (_current == _max)
btnNext.Enabled = false;
}