111,120
社区成员
发帖
与我相关
我的任务
分享 void 判断控件方法(Type c_l)
if(c_l.IsAssignableFrom(cl.GetType()))
{
aa();
} void 判断控件方法(Type c_l)
if(c_l==cl.GetType())
{
aa();
}
private bool compareType(Type targetType, object con)
{
if (con.GetType().Equals(targetType))
{
return true;
}
else
{
return false;
}
}
Button btn1 = new Button();
bool check1 = compareType(typeof(Button), btn1);
