0

Необходимо считать числа из textBox и записать их в массив i.stack.imgur.com/k9N1y.png

public void CreateRowsTextBox()
        {
            TextBox[] textBox2 = new TextBox[height_of_nonogram];
            for(int i = 0;i < height_of_nonogram; i++)
            {
               textBox2[i] = new TextBox();
                textBox2[i].Text = "Row " + (i + 1);
                Point p = new Point(200, 30*i);
                textBox2[i].Location = p;
                this.Controls.Add(textBox2[i]);

            }
        }
2
  • так и считываете my_mas[j] = textBox2[i].Text; 30 мая 2018 в 22:56
  • @TEA а как учитывать пробелы?
    – y47999
    30 мая 2018 в 22:59

1 ответ 1

0

//ваш предыдущий код

  int[] massiv = new int[100];
  for(int i = 0;i < height_of_nonogram; i++)
       {

либо TryParse http://www.quizful.net/interview/csharp/parse-tryparse-difference

massiv[i]  = Int32.Parse(textBox2[i].Text);

       }
2
  • System.FormatException: 'Input string was not in a correct format' @TEA
    – y47999
    30 мая 2018 в 23:25
  • так переделайте под свой код,я тут пример написал 30 мая 2018 в 23:26

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.