VisualHint's blog

Multiple values in a row

Here is the third post of the set I promised previously:

To store multiple variables in a single property is a new concept brought by SPG. I wanted to do it when a customer who bought the MFC version asked me if it was possible to have in one row a double value and its associated unit. Although it was feasible with some work it was not instantaneous, and even if this customer achieved to do it I decided to implement a built-in mechanism in the .NET version. And finally this is done. Here is a screenshot from my test app:

alt text

It will be demonstrated in the first demo to come.

So, what else can you do with that ? Your imagination is the limit here, but let's see another example. The font dialog is able to let the user choose a color for a font. But the font doesn't store the color. That's why the Microsoft PropertyGrid doesn't manage colors for fonts. SPG can allow you to store in one row a reference to a font and to a color. By writing the right Look class, it can be displayed the way you want (a color box followed by the font text or a colored font text, ...), and it will be edited by a font dialog that enables color selection.

Of course this is not limited to two variables. If you have some built-in arrangements of multiple variables that you would like to see developed in the package, just tell me.