문제

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