我有以下主要形式:(frmMain)
,有的则有:(button1, button2......)
。
然后我这样做:
object objectsContainer = frmMain; // <--now the object contains form base, button1, button2...
我能如何通过我反对的所有含有物品进入Tito1,但顿2......?
我这样做,但这不是我想要的东西。
foreach (PropertyInfo pInfo in objectsContainer.GetType().GetProperties())
{
}
我想做的是:
foreach (object objectFromForm in objectsContainer) // <--- how to do this looping an object (type of form)
{
//here is objectFromForm = base, button1, button2...
foreach (PropertyInfo pInfo in objectFromForm .GetType().GetProperties())
{
//here it s possible to access pInfo and its properties like size, name ...
}
}
当Im debuggin和审视物体的内容时 我想要的是集装箱。
一些建议?
最好。
** 本文件迟交。 本文件迟交。
UPDATE:
** 本文件迟交。 本文件迟交。
OK, I made a test project. There you could see what I want to do. In the project is an image with the objects... Here you can download it: http://www.mediafire.com/download.php?ik5j3ejnzm2
最好。