109,900
社区成员




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);