المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Controls.Add() Problem



C# Programming
08-06-2009, 12:21 AM
for (int i = 0; i < Frames.Count; i++)
{
if (!splitContainer3.Panel1.Controls.Contains(Frames[i]))
{
splitContainer3.Panel1.Controls.Add(Frames[i]);
}
Frames[i].Left = (Frames[0].Width + 20) * i;
Frames[i].Top = 20;
}

This should work, but only the Added control shows up. A test shows that the existing entries of the Controls collection are removed.
How do I fix?