Articles → WPF → Creating Your First Control Template In WPF
Creating Your First Control Template In WPF
- Create a WPF windows application.
- In the file Windows.xaml add a textbox control.
- Now add an attribute Style in the control.
- Add a Style tag in Grid.Resources
- Add the setter property inside the style tag. For writing control template setter property would be Template so the style tag would be
- In the ControlTemplate tag I am adding a border and inside the border there is a Grid and finally inside the grid there is an image and textbox. So the final code would be.
Click to Enlarge