• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1035
  • Last Modified:

change font size of grid child (textbox) in WPF

in WPF It it possible to change a grid child text box's font size during runtime?

i tried to do that:
foreach (Control ctrl in gridArray[i].Children)
            if(ctrl.GetType() ==typeof(TextBox))
                (TextBox)ctrl.FontSize = (double)5;


Open in new window

but it didnt work
1 Solution
It would be much easier to bind the FontSize on the Textbox controls to a class Property and prompt WPF to update the controls via INotifyPropertyChanged.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now