Okay this may seem too simple of a question but I’ve wasted enough time looking for how to do this. I am using CE 6.5 on a mobile device and I have a ContextMenu with six MenuItems. When the Menu pops up the first Item in the list is automatically highlighted. I want to remove this highlight as it is confusing some of my users in thinking that it is the current state. I looked into ContextMenu and all its variables and MenuItem and haven’t found out how to remove automatic highlight of first item. Same goes for a MainMenu’s too.
Share
I think the answer is, unfortunately, you can’t. I put in a strong effort this afternoon to get hold of that menu and I just couldn’t get a valid HMENU that the OS would allow me to use. If you want to continue trying to chase the path I was on the code is below, but I really think it’s a dead-end. At this point I’d consider P/Invoking everything for the menu (creation, population, etc) if you really need that feature.
EDIT
I knew I had code somewhere for doing all of this. We used to sell a commercial PopupMenu control that wrapped up all of the P/Invokes for menu creation. Sales for the control were small, so we pulled it from our product line a few years ago. I’ve now released it as open source over on Codeplex.