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

مشاهدة النسخة كاملة : Parent - Child



C# Programming
03-29-2009, 07:51 PM
Hi! I have a form called "Register" and a second form called "NewReg". From a button (in fact StripItem, however) in "Register" I call "NewReg" with code like this below and want "NewReg" to be set in the center of "Register":


NewReg NewRegToolWindow;
...

private void StripItem_NewReg_Click(object sender, EventArgs e)
{
NewRegToolWindow = new NewReg();

NewRegTool********Parent = this;
NewRegTool********StartPosition = FormStartPosition.CenterParent;
NewRegTool********ShowDialog();
}


Why doesn' t it work? It tells me: "Top-level control cannot be added to a control."

---------------------------------

EDIT: However, I get it! http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif

"Good artists copy, great artists steal."