change font size of grid child (textbox) in WPF

Posted on 2011-10-15
Last Modified: 2012-05-12
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
Question by:dpatel_team
    1 Comment
    LVL 27

    Accepted 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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now