private void DropDownLock_SelectedIndexChanged(object sender, EventArgs e) { // Displays different message depending on the selected item. switch (DropDownLock.SelectedIndex) { // None. case 0: TextBoxLockReason.Clear(); TextBoxLockReason.Enabled = false; Variables.Containers.Active.SetStatus("This license is not locked.", 3); break; // Banned. case 1: case 2: TextBoxLockReason.Text = "None Specified"; TextBoxLockReason.ForeColor = System.Drawing.Color.DarkGray; TextBoxLockReason.Enabled = true; Variables.Containers.Active.SetStatus((DropDownLock.SelectedIndex == 1 ? "License is locked, will expire." : "License is locked, will not expire."), 3); break; } // Enables the 'Save' button if the selected item is changed. ButtonSave.Enabled = true; }
private void TextBoxLockReason_Enter(object sender, EventArgs e) { if (TextBoxLockReason.Text == "None Specified") { TextBoxLockReason.Clear(); TextBoxLockReason.ForeColor = System.Drawing.Color.Black; } }