Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9044997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:08:08+00:00 2026-06-16T11:08:08+00:00

I have multiple XAML TextBox es, each of which manipulate a corresponding value in

  • 0

I have multiple XAML TextBoxes, each of which manipulate a corresponding value in an array, when the value in the TextBox is changed, using a C# method which dynamically checks which TextBox has called the method.

    <TextBox x:Name="_0_0" TextChanged="_x_y_TextChanged"/>
    <TextBox x:Name="_0_1" TextChanged="_x_y_TextChanged"/>
    <TextBox x:Name="_0_2" TextChanged="_x_y_TextChanged"/>
    // And so on.....

each of which manipulate a corresponding value in an array, when the value in the TextBox is changed, using a C# method which dynamically checks which TextBox has called the method.

    private void _x_y_TextChanged(object sender, TextChangedEventArgs e)
    {
        TextBox current = (TextBox)sender;
        string currentname = current.Name;
        string rowstring = currentname.Substring(1, 1);

        string columnstring = currentname.Substring(3, 1);

        int row = Convert.ToInt32(rowstring);
        int column = Convert.ToInt32(columnstring);

        // I've then detected the name of the textbox which has called it...

So this information can be used to dynamically store information from a TextBox in a corresponding array index – or whatever you want to do with it…

My question however, is:

How can I create a method which uses index locations in my array, to call the relevant TextBox and update its text?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:08:10+00:00Added an answer on June 16, 2026 at 11:08 am

    Use FindName(string) to find the text box by name as follows (where container is a control that contains all of the text boxes):

    private void UpdateTextBox(int row, int column, string text)
    {
        TextBox textBox = container.FindName("_" + row + "_" + column) as TextBox;
        if(textbox != null)
        {
            textbox.Text = text;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a XAML window with multiple TextBoxes, each with a corresponding TextBlock tag
We have a custom WPF control with multiple TextBox . Each TextBox has its
I have a process which I break into multiple processes and even when using
I have multiple projects which are to be hosted together in a Tomcat container,
I have a listbox that has a datatemplate which contains multiple text boxes. I
I have a huge XAML theme with multiple control templates and styles. I need
My situation is this. I have multiple projects under a WPF solution which make
Programatically, I want to load many resources (XAML) which are spread across multiple assemblies.
I have a view named Work.xaml. This Work.xaml contains multiple WorkSkeleton.xaml. The Work.xaml's ViewModel
I have a TextBox thats using this Style. I need to add a Focus()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.