private void UpdateButtonState()
{
if (this.ListColumns.SelectedItems.Count == 0)
{
this.ButtonMoveUp.Enabled = false;
this.ButtonMoveDown.Enabled = false;
this.ButtonShow.Enabled = false;
this.ButtonHide.Enabled = false;
}
else
{
if (this.ListColumns.SelectedItems[0].Index == 0)
{
this.ButtonMoveUp.Enabled = false;
}
else
{
this.ButtonMoveUp.Enabled = true;
}
if (this.ListColumns.SelectedItems[0].Index == this.ListColumns.Items.Count - 1)
{
this.ButtonMoveDown.Enabled = false;
}
else
{
this.ButtonMoveDown.Enabled = true;
}
if (this.ListColumns.SelectedItems[0].Checked)
{
this.ButtonShow.Enabled = false;
this.ButtonHide.Enabled = true;
}
else
{
this.ButtonShow.Enabled = true;
this.ButtonHide.Enabled = false;
}
}
}