Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Windows.Forms;
- using System.Linq;
- namespace Planets
- {
- public partial class MainForm : Form
- {
- public MainForm()
- {
- InitializeComponent();
- string[] Output = _planets.PlanetsList
- .Select(s => s.Planet)
- .Distinct()
- .ToArray();
- for (int i = 0; i < Output.Length; i++)
- {
- var rbtn = new RadioButton();
- rbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F);
- rbtn.Location = new System.Drawing.Point(32, 30 + 24 * i);
- rbtn.Name = Output[i] + "_rbtn";
- rbtn.Size = new System.Drawing.Size(104, 24);
- rbtn.TabIndex = i;
- rbtn.TabStop = true;
- rbtn.Text = Output[i];
- rbtn.UseVisualStyleBackColor = true;
- grpPlanets.Controls.Add(rbtn);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement