How do I add more than 1 style to a TextBox?
-
Hi, I have a MultidataTrigger Condition style thats been implemented to a TextBox [1]. I also have another style which I require to implement on the NameTextBox. How do we implement multiple styles on a Text Box? [1]
<TextBox x:Name="NameTextBox" Style="{StaticResource requiredFieldValidationTextBoxStyle}" Text="{Binding Path=Name}" Width="100"/>
Regards, Vipul Mehta
-
Hi, I have a MultidataTrigger Condition style thats been implemented to a TextBox [1]. I also have another style which I require to implement on the NameTextBox. How do we implement multiple styles on a Text Box? [1]
<TextBox x:Name="NameTextBox" Style="{StaticResource requiredFieldValidationTextBoxStyle}" Text="{Binding Path=Name}" Width="100"/>
Regards, Vipul Mehta
-
Hi, I have a MultidataTrigger Condition style thats been implemented to a TextBox [1]. I also have another style which I require to implement on the NameTextBox. How do we implement multiple styles on a Text Box? [1]
<TextBox x:Name="NameTextBox" Style="{StaticResource requiredFieldValidationTextBoxStyle}" Text="{Binding Path=Name}" Width="100"/>
Regards, Vipul Mehta
You have to create a new style - you could always have this style BasedOn the initial style, and then implement the bits you need on top.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
-
You have to create a new style - you could always have this style BasedOn the initial style, and then implement the bits you need on top.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
Pete is correct here.
Cheers, Karl
» CodeProject 2008 MVP My Blog | Mole's Home Page | XAML Power Toys Home PageJust a grain of sand on the worlds beaches.
-
You have to create a new style - you could always have this style BasedOn the initial style, and then implement the bits you need on top.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
-
That's not really using two styles on a control though is it? It's just basing one style on another style as far as I can tell.
Jammer My Blog | Article(s)
True - that's why I said you had to create a new style. There's no way round this as you noted earlier.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
-
True - that's why I said you had to create a new style. There's no way round this as you noted earlier.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
-
Gotcha ...
Jammer My Blog | Article(s)
And to clarify the point, I 5d your answer above. That should make it plain for the OP.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
-
And to clarify the point, I 5d your answer above. That should make it plain for the OP.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
-
:) I've not actually used the BasedOn approach to a styles yet. Could prove interesting to see how it actually works.
Jammer My Blog | Article(s)
I use it a lot - it's incredibly useful.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith