Home > DeveloperSection > Forums > How to Target all Textbox's within a Groupbox on a Window – WPF
Ankita Pandey
Ankita Pandey

Total Post:183

Posted on    February-04-2014 5:51 AM


 1 Reply(s)
 1519  View(s)
Rate this:

I am trying to setup a windows.resoruces style that targets all textbox's within all groupbox's (so it would not target textbox's that are not found within a groupbox)

I know I could use the x:key field, but was wondering if there was a way to target certain controls within controls for an entire window or application?

Pravesh Singh

Total Post:412

Posted on    February-04-2014 6:02 AM

Hi Ankita,

You could try a nested style for your TextBoxes in Style.Resources of GroupBox with Style.TargetType but without x:key.

<Style TargetType="GroupBox">


        <Style TargetType="TextBox">





Don't want to miss updates? Please click the below button!

Follow MindStick