private void readOnlyCheckBox_CheckedChanged(object sender, EventArgs e) { ProgramTextBox.ReadOnly = readOnlyCheckBox.Checked; ProgramTextBox.BackColor = ProgramTextBox.ReadOnly ? SystemColors.Control : SystemColors.Window; ProgramTextBox.Update(); }