解决方案 »
- 一个ListView刷新性能的问题
- 请问这个控件如何用。
- OCIENVCREATE失败,返回代码为-1,但错误消息文本不可用
- DataGridView 数据刷新问题 注意是winform
- MDI窗口里打开一个窗口A,怎么在A窗口里打开一个窗口B,让这个窗口B属于MDI窗口的子窗口
- int 和 int32,int16区别大吗
- 如何用正则表达式获取所有的超级链接(A)标签
- 高手指引一下:System.NullReferenceException: 未将对象引用设置到对象的实例。
- C# PPC编程问题
- 操作注册表出现的异常
- access参数化查询,查不到数据,在公司急等答案
- 关于异步socket的一点小疑问
{
//......
}
{
只懂列出控件的,不懂sqlConnection;
}
{
//......
}OK
{
if (control is System.Windows.Forms.TextBox)
{
System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ;
tb.Text = String.Empty ;
}
}
{}这样的时候,表单中的好多东西列不出来的.
这样论坛不显示,可以将图片传到csdn论坛空间相册在引用。
这样可以将我在设计时就放在表单中的sqlConnection,SqlDataAdapter列出来吗?好像不能哟...
{
public Form1()
{
InitializeComponent(); DoIt(this.Controls );
} void DoIt(Control.ControlCollection CC)
{
foreach (Control C in CC)
{
MessageBox.Show(C.Name); DoIt(C.Controls);
}
}
}
{}
comboBox1,button1,propertyGrid1,treeView1还有三个不能列出来:form1,sqlConection1,sqlCommandBuild1我是想这七个东西全部列出来.
自已写不写没关系,关健我要把已经放在FORM上的给列出来.
{
if (control is System.Windows.Forms.TextBox)
{
System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ;
tb.Text = String.Empty ;
}
}
{
MessageBox.Show(C.ToString()); if (C is Timer)
{
Timer T = (Timer)C;
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;namespace WindowsApplication230
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent(); foreach (FieldInfo FI in this.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic))
if (FI.FieldType.IsSubclassOf(typeof(Component)))
MessageBox.Show(FI.Name);
}
}
}
{
MessageBox.Show(C.ToString()); if (C is Timer)
{
Timer T = (Timer)C;
}
} 这个应该是对的。
再不行你就反射了。
[System.Windows.Forms.TImer], Interval: 100还有,你是用03吗
{
foreach (Component c in this.components.Components)
{
MessageBox.Show(c.ToString());
}
}