![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Why is this so difficult (Template question) Hello all, I'm trying to do something that I thought would be simple with wpf. Basically, I want to create a template that sticks a TextBlock on the end of a ComboBox. The idea is that when my forms are in "edit" mode that the required fields are marked with a red asterisk. While I've figured out how to do this with a textbox: <Style x:Key="RequiredEditableTextBox" TargetType="{x:Type TextBox}"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate x:Key="RequiredEditableTextBoxTemplate" TargetType="{x:Type TextBox}"> <StackPanel Orientation="Horizontal"> <TextBox Text="{TemplateBinding Text}"/> <TextBlock Style="{StaticResource RequiredFieldGlyph}"/> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> I'm mystified as to how one would accomplish this with a more complex control like a combobox. What I really want is a template that refers to the parent control, essentially saying "Draw yourself here" <Style x:Key="RequiredEditableComboBox" TargetType="{x:Type ComboBox}"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate x:Key="RequiredEditableComboBoxTemplate" TargetType="{x:Type ComboBox}"> <StackPanel Orientation="Horizontal"> ---I WANT TO DRAW THE ORIGNIAL COMBOBOX HERE -- <TextBlock Style="{StaticResource RequiredFieldGlyph}"/> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> But I can figure out how. The difficulty I'm having leads me to believe that I may be thinking of the problem in the wrong context etc. Any ideas would be appreciated. Thanks -r |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Easy v/s Difficult | Chillout Room | |||
| Vista is very difficult to use | Vista General | |||
| Difficult question | Vista General | |||