Here's an easy way to implement it -
class MyTemplate : KeyTemplate
{
public override void Draw(Graphics g, Key key, Mode mode, Font font)
{
var regKey = key as RegularKey;
if (regKey != null)
{
var replacement = (RegularKey)regKey.Clone();
replacement.Content = VirtualKeyboard.ShiftLocked ?
regKey.CapitalCase : regKey.LowerCase;
base.Draw(g, replacement, mode, font);
return;
}
base.Draw(g, key, mode, font);
}
}
You could as well draw the label directly with lower-level Graphics API -
var label = VirtualKeyboard.ShiftLocked ?
regKey.CapitalCase : regKey.LowerCase;
g.DrawString(
label, font, Brushes.Black,
(float)(key.Left + key.Width / 2),
(float)(key.Top + key.Height / 2),
StringFormat.GenericDefault);
In latter case you'll also have to implement drawing code for the keys' background and borders.
Regards,
Slavcho
Mindfusion