Instances used in a project are displayed in a new window based on the number of radioButton instances to be displayed.
// Dynamically display radioButton public void showRadioButton (int listSize, List <String> list) {// The distance between the edge on the control and the edge on the container int top = 6; // record loop, int I = 0; int n = 0; RadioButton [] radioButton = new RadioButton [listSize]; for (n = 0; n <listSize; n ++) {if (n % 15 = 0 & n! = 0) {I ++; if (I % 5 = 0) {top = 6 * n; I = 0 ;}else {top = 6 ;}} radioButton [n] = new RadioButton (); radioButton [n]. autoSize = true; radioButton [n]. top = top; // coordinates of the upper left corner of the control relative to the upper left corner of the container, and the distance between each control, radioButton [n]. location = new Point (I * 150 + 2, top); // MessageBox. show (name [n]. toString (); radioButton [n]. text = list [n]. toString (); radioButton [n]. visible = true; radioButton [n]. name = "radioButton" + n; this. panel1.Controls. add (radioButton [n]); top = top + 21 ;}}