private void Form_Shown(object sender, EventArgs e)
{
// Load Settings
this.tsmiDuplexEnabled.Checked = Properties.Settings.Default.DuplexEnabled;
this.tsmiRemoveBlanks.Checked = Properties.Settings.Default.AutoDiscardBlanks;
this.tsmiColorMode.DropDownItems[Properties.Settings.Default.ColorMode].Checked = true;
}
The last line does not work because it doesn't find the checked property, although there are many available properties. Any idea how I can get at that property?
You need to cast it as a
ToolStripMenuItem
to get theChecked
property. Note that separators are notToolStripMenuItem
so you can't blindly cast everyDropDownItem
as aToolStripMenuItem
.For example:
In your case it looks like you won't accidentally get a separator, so this should work: