例如:
string str = "this.txtBox1"
然后把它弄成str.Text = "AA",
使其结果等同于C#语句: this.txtBox1.Text = "AA";或是将string str = "txtBox" //
然后有没有办法将其转换成一个txtBox对象?
string str = "this.txtBox1"
然后把它弄成str.Text = "AA",
使其结果等同于C#语句: this.txtBox1.Text = "AA";或是将string str = "txtBox" //
然后有没有办法将其转换成一个txtBox对象?
解决方案 »
- C#如何向excel文件中插入另一个excel表
- .net进度问题
- C# Gridview创建的ItemTemplate字段列位置如何调后?
- Winform 中如何设置控件在面板中居中
- winform中将datagrid导出为EXCEL文件
- 对数据进行加密、解密
- 兄弟们,求字符类型转换的问题,谢谢了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
- 困惑已久的问题: 执行insert或update,数据更新到数据库中速度很慢并且有可能丢失?!
- 菜鸟问题。。。。。。。。。。在线等!!
- 我启动VS .net 7.0时,总有“除以0”的提示错误提示,怎么回事?如何解决?
- 急急急!如何在tabpage中动态加载form?就是把form嵌入到tabpage里
- Thread类的线程和线程池ThreadPool中的线程哪个速度更快?
使用反射生成一个窗体的例子:
Assembly assm = Assembly.LoadFrom("e:\\WindowsApplication.dll");
Type TypeToLoad= assm.GetType("WindowsApplication.Form1");
object obj;
obj = Activator.CreateInstance(TypeToLoad);
Form formToShow = null;
formToShow = (Form)obj;
formToShow.Show();另外参考,
http://www.c-sharpcenter.com/CSNET/dynamicinvoke.asp
http://www.c-sharpcorner.com/Code/2002/April/LoadingAssemblyInfo.aspDynamically load a class and execute a method in .NET
http://www.codeproject.com/csharp/DynLoadClassInvokeMethod.asp