Reputation: 311
I want to set up controls that are visible to administrators only, now the only problem with checkbox controls is, do I not know how to make it visible only to users? But they do not have the ability to click and change the value of the checkbox. This is my code current.
admin = IsAdministrator(userID);
if (admin)
{
comboBox1.DataSource = dataAccess.GetAll();
comboBox1.DisplayMember = "FullName";
comboBox1.ValueMember = "ID";
labelName.Visible = false;
}
else
{
comboBox1.Visible = false;
txtBoxSaldo.ReadOnly = true;
txtBoxSaldo.BackColor = SystemColors.Window;
buttonSaveChanges.Visible = false;
}
Upvotes: 4
Views: 283