我想做一个arrylist数组,用来存放radiobutton对象,,怎么实现??
解决方案 »
- 对话框的 Filter属性的使用!
- 在COM组件生成实例时,可否带参数?
- 关于C# 库引用的问题
- Socket 中有没有类似tcplistener.pending()的方法来判断有没有连接?(一定结帖)
- 在web中视频捕获,并且把视频和声音录下来,怎么实现?
- 有没有成功开发过 mapx + c# 的?
- 谁有聊天室的源代码?
- Quartz.Net-----JobDetail重名异常,求解,急!!!
- 毕业三年了,做过一年VB,两年维护,现在不想再做维护了,想去培训充电?
- 我用c#调用其他厂家的DLL总是不成,大家帮忙看看
- 如何在Visual Studio2005中安装visio
- 求一函数,返回一个object对象~~
为什么要做成数组 ?就算数组也能放radiobutton 对象的,因为arrylist 添加的参数是object.
而所有类都是继承自object
RadioButton rd=new RadioButton();
al.Add(rd);取出来
RadioButton rdo=al[0] as RadionButton;
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;
}
}
}
RadioButton rd=new RadioButton();
al.Add(rd); 取出来
RadioButton rdo=al[0] as RadionButton;