开发者

position one form on top of its owner form

开发者 https://www.devze.com 2023-02-08 00:29 出处:网络
i have an mdiform which is my main application form. and i\'m t开发者_如何转开发rying to implement the following:

i have an mdiform which is my main application form. and i'm t开发者_如何转开发rying to implement the following:

when the user want to create a new "product", a new form is created (which is not a child form, just a wizard like form) where the user enter all the needed information. once the user click next i would like to "shadow" the mdi form with another form that i created called popup. my problem, when i'm trying to position the child (popup) form on top of the mdi form, it always get offset (i'm using the Mdi.Location to set my popup location form) a little to the top and to the left.

i tried PointToScreen and PointToClient, but none produced a solution. does anyone has any idea what am i doing wrong here?

Thanks


Not quite sure what the problem might be. You'll have to take charge of the StartPosition property of the form. The default is "WindowsDefaultLocation" which is very apt to put it in a place you don't particularly like. Change it to "Manual", set the Location property before you call Show(). Yes, those are screen coordinates, nothing relative.

0

精彩评论

暂无评论...
验证码 换一张
取 消