Загрузка данных


using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace AppInventorToWinForms
{
    public partial class Form1 : Form
    {
        // initialize global name1 to create empty list + add item
        private List<Color> name1 = new List<Color> { Color.Red };

        public Form1()
        {
            InitializeComponent();
        }

        // to procedure1 result get global name1
        private List<Color> Procedure1()
        {
            return name1;
        }

        // when Button1.Click do
        private void Button1_Click(object sender, EventArgs e)
        {
            // set Button1.BackgroundColor to select list item (index 0)
            Button1.BackColor = Procedure1()[0];
        }
    }
}