Cause SplitButton to update its CurrentButton to the new split selection

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When selecting one of the not currently visible pushbuttons for a SplitButton that one has intentionally made so that the SplitButton is available at the command class executed by the splitbutton's pushbutton, the CurrentButton property for the SplitButton is not yet updated. Its CurrentButton property is that of the pushbutton that was visible at the time the underlying selected pushbutton was selected. But, that CurrentButton property will have been updated after a form like a MessageBox has been show. For example in the following code in the command class, the first MessageBox shows the pushbutton's name for the visible pushbutton while the second MessageBox shows the pushbutton's name for the actual pushbutton selected in the SplitButton stack.
MessageBox.Show(AppFarClip.Instance.sbFarClip.CurrentButton.Name); MessageBox.Show(AppFarClip.Instance.sbFarClip.CurrentButton.Name);
What would be some other way to force the CurrentButton property to update? I am trying to find a way for the called command class to discover which button in the stack called it. The idea is to use that Name for a key into a dictionary of name/argument list that a universal command class could use. I've tried using a self closing form. Thankyou.