private void Form1_Load(object sender, EventArgs e) { jsonrw t = new jsonrw(); ChLists = new List <ChList>(); oustr = new List <String>(); Transps = t.getTr(); int q = 0; foreach (var O in Transps) { foreach (String S in O.channels) { ChList chl = new ChList(q, S); ChLists.Add(chl); oustr.Add(S); } q++; } oustr.Sort(); Button[] tb = new Button[20]; for (var i = 0; i < Transps.Count; i++) { Transp d = Transps.ElementAt(i); tb[i] = new Button(); tb[i].Location = new Point(8, 20 + i * 30); tb[i].Name = d.id.ToString(); tb[i].Size = new Size(105, 23); tb[i].TabIndex = i; tb[i].Text = d.id.ToString() + "000 KGz"; tb[i].Click += this.OnButtonClick; groupBox1.Controls.Add(tb[i]); } cB.DataSource = oustr; setList(); }
private void SaveBtn_Click(object sender, EventArgs e) { jsonrw t = new jsonrw(); t.setTr(Transps); }