質問

I currently have a menu button that allows users to open a new dialog which I would like to be placed directly to the right of the main form. The user can open as many of these dialogs as they would like but I would like them to cascade on top of the first dialog that they opened (if there is one). I've seen ways to do something similar using an MdiLayout but this is just for normal dialogs.

役に立ちましたか?

解決

Do you want to loop through all the open dialogs, setting each windows location?

this.Location = new Point(x,y);

or

int prevHeight =0;
foreach (Form f in this.OwnedForms)
{
x += 5;
y += prevHeight;
f.Location = new Point(x, y);
prevHeight += f.Height;
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top