C# Programming
03-29-2009, 04:13 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."
"Good artists copy, great artists steal."
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."
"Good artists copy, great artists steal."