问题如题。
例如:
public class DemoForm : Form
{
public int Value
{ get; set;}
} class program
{
public static void ShowForm(FormClass AFormClass) // 问题1 如何定义 FormClass
{
Form AForm = new AFormClass();
AForm.Show();
}
static void Main()
{
ShowForm(DemoForm);
}
}
例如:
public class DemoForm : Form
{
public int Value
{ get; set;}
} class program
{
public static void ShowForm(FormClass AFormClass) // 问题1 如何定义 FormClass
{
Form AForm = new AFormClass();
AForm.Show();
}
static void Main()
{
ShowForm(DemoForm);
}
}
解决方案 »
- 请教,为什么dataGridView里不显示数据
- 有没简单的C#对数据库SQL server 2000表实现查询,插入,更新,删除的例子啊?
- 数据结构好的兄弟们进来,求教一个首领的算法
- 关于WAP的问题,请大家帮个忙
- 网络异步传输问题~~大哥们进来帮忙啊~[解决即给分]
- 如何使用正则保留html代码中的img table h1-h4 以及href 标记啊?
- 怎样用C#得知系统当前是否处于internet链结状态?仅剩最后40相赠啦!
- c#中根据xml shema 生成xml文件的问题。
- 在线等待!读文件保留到数组的问题?
- DataGrid加入一个ComboBox
- 分不多。c#操作windows2000文件权限问题,高手进
- C#内存分配的一点疑问
在函数内转换就行了
{
Object obj = Activator.CreateInstance(formType);
Form t = obj as Form;
if (t != null)
{
t.Show();
}
}
可是可不可以象Delphi这样定义 FormClass = Class of TForm