This is a migrated thread and some comments may be shown as answers.

Padding inside Controls

2 Answers 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
steffen
Top achievements
Rank 1
steffen asked on 19 Mar 2013, 09:01 PM
Hi,

how can I set the Padding inside of a DatePicker or TextBox control to 0.
Please see attached picture (padding in red) the blur border is the selected datePicker control.
Seems to be inside the control template.

regards steffen

2 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 19 Mar 2013, 09:58 PM
Hi Seffen,

You have two choices to bring those edges out. The first is the easiest and provides the same effect as the second.

1- Add a negative margin to that edge.
2- Extract the control template.

Extracting the template can be done in Visual Studio 2012 or in Blend for Visual Studio. Here are the steps:

Locate the instance of the control in the Objects and Timeline (Blend) or the Document Outline (VS2012) panel.
Right click on the control, locate and expand the option named "Edit Template"
Select "Edit a copy"

The control template will be extracted and then you can edit its parts. This will create a resource that the control will use for its Style property.

Good luck!
Lancelot
0
Jini
Top achievements
Rank 1
answered on 02 Jul 2013, 06:27 AM
GetTemplateChild can only be used from "your control" to get a control defined in it's [control]template. 
Tags
General Discussions
Asked by
steffen
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Jini
Top achievements
Rank 1
Share this question
or