comentsys.wordpress.com today features a Universal Windows Platform tutorial showing how to create a Custom TextBox with a customised look-and-feel for the TextBox control.
Within the App.xaml is defined an Application.Resources with a Style of “CustomTextBoxStyle” and a TargetType of TextBox – this example takes a copy of the style for the standard TextBox and customises many of the properties including Foreground set to “Gold”, during the VisualState of PointerOver a BorderBrush has been set to “GoldenRod” and the VisualState of Focused has the BorderBrush set to “Gold”.
The Border has the default BorderBrush set to “Salmon” and the Background to “LightSalmon” with a CornerRadius set to “15” and the ContentPresenter has the Foreground set to “Gold” – some other elements including the Header and DeleteButton have been removed to simplify the TextBox.
Behind the Scenes
This is a straightforward example and Expression Blend was used to create a copy of the standard Style for a TextBox which was then customised with a look-and-feel that’s been used in previous tutorials just to demonstrate how different a standard input control can be modified, more sophisticated customisation is possible – the example is just the start of the idea of creating a completely custom look to an application by modifying controls in this way.