Great questions, here are answers:
1. Font color:
There is a bug that got fixed yesterday where ForeColor wasn't being respected so it won't appear in the CTP builds for a while. Until you see that changed you need to override the Pro Renderer's OnRenderItemText() and set e.TextColor like so:
| | public partial class Form1 : Form { public Form1() { InitializeComponent(); ToolStripProfessionalRenderer tsp = new MyToolStripProfessionalRenderer(); ToolStripManager.Renderer = tsp; } } class MyToolStripProfessionalRenderer: ToolStripProfessionalRenderer { protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) { e.TextColor = Color.HotPink; base.OnRenderItemText(e); } } |
after that, you'll just be able to set ForeColor.
2. MultiSelect ContextMenuStrip
Sync the closing (cancellable) event - check closereason and don't respect itemclicked, by returning true.
| | public partial class Form1 : Form { public Form1() { InitializeComponent(); ContextMenuStrip cms = new ContextMenuStrip(); cms.Items.Add("Apples"); cms.Items.Add("Bananas"); cms.Items.Add("Cherries"); cms.Closing += cms_Closing; this.ContextMenuStrip = cms; foreach (ToolStripMenuItem tsmi in cms.Items) { tsmi.CheckOnClick = true; } } void cms_Closing(object sender, ToolStripDropDownClosingEventArgs e) { if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked) { // could also check for specific "Ok" item in e.Item e.Cancel = true; } } |