Modal dialog form not in the center of parent when application tiled
I have a small app that requests user input ever couple of minutes. The app produces a modal pop up and waits for the user input but when the app is tiled with other programs the dialog appears randomly in different locations on the screen.
I've开发者_开发百科 set the position in the constructor to CenterParent, and it doesn't work. Am I missing something here?
You may have forgotten to set the parent correctly in the Show command? It should be set to the form that you want it to center with.
yourFormInstance.Show(parentForm);
EDIT: asker came with solution. He meant that clicking Tile Windows reorganizes windows, including his one (after it was already shown). The solution: myForm.ShowInTaskbar = false;
.
精彩评论