我想做的用户控件如下:“类型或命名空间名称找不到”在用户控件
foreach(Control c in this.Controls)
{
if(c is CheckBox)
{
// Do stuff here
}
}
但我得到的错误:
Error 1 The type or namespace name 'Control' could not be found (are you missing a using directive or an assembly reference?)
Error 2 The type or namespace name 'CheckBox' could not be found (are you missing a using directive or an assembly reference?)
三江源指导。
你看了错误消息System.Windows.Controls?它告诉你到底是什么问题。您需要导入对应于'Control'和'Checkbox'的2个DLL。 – tnw 2013-04-04 13:52:10
您是否导入了'System.Windows.Forms.Control'? – Joetjah 2013-04-04 13:51:14