Search code examples
c#ribbon

What's the difference between CheckBox and ToggleButton on a ribbon?


As far I can see, there's only one difference between a CheckBox and ToggleButton - the visual appearance on the ribbon. While the first one will be checked/unchecked, the latter will glow or not.

Moreover, when added to a menu, even the toggle button control will be rendered as a check box! No difference at all, in that case.

  1. Functionality is the same: a GUI representation of a bool.
  2. Extensibility is the same: both can be inherited and remade into a tri-state control.
  3. Programmability is the same: both have the same delegate signature for event handling.

Am I missing something? In such case - what?


Solution

  • This dichotomy has existed elsewhere for a long time already. Yes, functionally they're always the same. It's probably up to the specific case where they are used. E.g. if I look in Word then the document views are toggle buttons:

    enter image description here

    whereas the various things that can be shown separately (e.g. ruler, grid, etc.) are check boxes:

    enter image description here

    It seems that the toggle buttons in that case are used as radio buttons. Also a toggle button makes the current state much more visible than just a checkbox, so if a toggle choice is more important than the rest around it, then it might make sense to use it.

    I'd say pick a style you're using and the criteria when you are using it and do so consistently.