Most applications have a requirement to let the user select a color. This is the purpose of the new KryptonContextMenuColorColumns item that is used with the KryptonContextMenu.  Below you can see a context menu that has four instances of the new item, with a heading above each item giving a description of the enum used to define the colors…

The last two instances present the colors as seem in Office 2007 applications allowing you to closely mimic those style of apps. The first three are simpler sets of colors that I think will be commonly required.

You are not forced into using the predefined color sets, instead you can provide your own set of colors, although you need to do this in code by calling a method. Also configurable are the size of the individual color blocks and the placement of rows…

There are two events generated by the item, SelectedColorChanged is fired when the user selects a color block and TrackColor is fired as you move the mouse, or keyboard, over different items. Use TrackColor if you want to provide a live update of how a change will look if that item is selected.

If you want to help decide how the rest of the implementation should proceed then add a comment on the following two issues…

- Are there any other color sets you would like predefined?
- Is there some standard implementation you would like?

For example, would you like a predefined context menu that already has full color selection functionality built in, like the context menu that appears when you click the Font Color button in Word 2007? If so then what functionality should be present and what would need to be optional?

4 Responses to “ColorColumns for ContextMenu”

  1. jkr Says:

    instead of having predefined colours you could create a (let’s say) ColorMenuItem and you can specify the color (.ColorValue for instance). these ColorMenuItem’s could be placed in a “special” container called (again, let’s say) ColorMenuContainer, thus having other Standard on Non-Standard MenuItems (Checkbox – Use System Colors, Office 2003 Colors, Palette Colors; Button – Customize Colours).
    of course you can still have an option in the designer to add standard color columns.

  2. Vesuvius Says:

    You need to add this as a tool strip menu item so this can be used in the ribbon as well as the toolkit. Users can then choose a font colour or background colour in word processing type application

  3. jkr Says:

    not only a word processing app.
    let’s say you have a “something” tracker and an item has a state or a priority you can select it’s state/priority, and here comes the idea … can a “ColorMenuItem” have a label? (for priority – high, medium, low, ignore)

  4. Phil Wright Says:

    I will certainly be adding a ribbon item so you can quickly add the ability to select colors in the applications.

Leave a Reply