---
title: "How to Target all Textbox's within a Groupbox on a Window – WPF"  
description: "How to Target all Textbox's within a Groupbox on a Window – WPF"  
author: "Anonymous User"  
published: 2014-02-04  
updated: 2014-02-04  
canonical: https://www.mindstick.com/forum/1958/how-to-target-all-textbox-s-within-a-groupbox-on-a-window-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# How to Target all Textbox's within a Groupbox on a Window – WPF

I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to [setup](https://www.mindstick.com/articles/426/how-to-create-a-setup-project-for-windows-application) a windows.resoruces [style](https://www.mindstick.com/articles/126300/apa-citation-style-get-to-know-about-it-for-your-next-assignment) that [targets](https://yourviews.mindstick.com/view/81357/us-president-donald-trump-targets-china-yet-again) all [textbox](https://www.mindstick.com/forum/12714/dynamic-textbox-in-gridview)'s within all groupbox's (so it would not [target](https://yourviews.mindstick.com/view/81207/small-industries-should-be-the-target-of-economic-relief-package) 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](https://www.mindstick.com/articles/66/how-to-create-controls-at-run-time-in-csharp-dot-net) within controls for an entire [window](https://www.mindstick.com/forum/161285/how-does-the-window-console-object-work-in-javascript) or [application](https://www.mindstick.com/articles/12824/calculator-application-in-android)?

## Replies

### Reply by Pravesh Singh

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.Resources>

<Style TargetType="TextBox">

...

</Style>

</Style.Resources>

</Style>


---

Original Source: https://www.mindstick.com/forum/1958/how-to-target-all-textbox-s-within-a-groupbox-on-a-window-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
