-2

First. I create a group of 5 labels using a for

for (byte fila = 0; fila < 5; fila++)
        {
            Label letras = new Label();

            letras.Height = alto;
            letras.Width = ancho;
            letras.BackColor = Color.Blue;
            letras.ForeColor = Color.AntiqueWhite;
            letras.Font = new Font("Arial", 60);
            letras.TextAlign = ContentAlignment.MiddleCenter;
            letras.BorderStyle = BorderStyle.FixedSingle;
            letras.Left = 200 + (ancho + 20) * fila;
            letras.Top = 60;
            letras.Text = null;
            letras.Visible = false;
            letras.MouseMove += new 
            System.Windows.Forms.MouseEventHandler(this.letras_MouseMove);

            this.Controls.Add(letras)

Second. I have a list of words declared as list of strings of 5 characters.

List <string> palabras = new List <string> { "limón", "bufón", "leche", "video", 
"guiso",
            "dulce", "gusto", "audaz", "vacío", "huevo", "avena", "guapo", "ozono", 
"audio",
            "zanja", "pausa", "freno", "débil", "hurto", "otoño", "libro", "pluma", 
"disco",
            "fruta", "melón", "papel", "mapeo", "nuevo", "banco", "tigre", "mundo", 
"hueco",
            "cable", "funda", "lápiz", "botón", "tonto", "regla", "tipas", "canal" };

I need to call one of them (words) and put each of the characters in a label of the group of labels I created first, in an altered order (5, 3, 1, 2, 4). I ´ve tried with substrings function but I always have errors. ¿Any suggestions?

1 Answers1

0

string is basically an array of char, so you can access specific chars by their index, e.g.

string text = "Hello world!";

// this will write 'H'

Console.WriteLine(text[0]);
obnews
  • 602
  • 5
  • 13