我想做一个arrylist数组,用来存放radiobutton对象,,怎么实现??

解决方案 »

  1.   

    List<radiobutton> a=new List<radiobutton>;
      

  2.   

    用一个arrylist ,将radiobutton 对象添加就可以了把?
    为什么要做成数组 ?就算数组也能放radiobutton 对象的,因为arrylist 添加的参数是object.
    而所有类都是继承自object 
      

  3.   

    ArrayList al=new ArrayList();
    RadioButton rd=new RadioButton();
    al.Add(rd);取出来
    RadioButton rdo=al[0] as RadionButton;
      

  4.   

    随便放,放自己都可以
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Collections;namespace WindowsApplication21
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();            ArrayList AL = new ArrayList();
                AL.Add(new Button());
                AL.Add(AL);
                ((Button)((ArrayList)AL[1])[0]).Parent = this;
            }
        }
    }
      

  5.   

    ArrayList al=new ArrayList(); 
    RadioButton rd=new RadioButton(); 
    al.Add(rd); 取出来 
    RadioButton rdo=al[0] as RadionButton; 
      

  6.   

    说下.ArrayList什么都可以放的 ``但是转换回来要考虑拆箱的性能遗失
      

  7.   

    arrylist,本来就是对象的集合直接add();