我可以定位.NET的(表格)消息框或通用对话框? [英] Can I position .net's (Forms) Message box or Common dialogs?

查看:150
本文介绍了我可以定位.NET的(表格)消息框或通用对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让父窗体,而不是中央屏幕的行为中心。 传入父窗体似乎只控制窗口的所有权。 这些类是密封的,所以我不看我怎么可以做任何WinProc把戏。 重写的类不是一个有吸引力的选择。 任何其他的想法?

I am trying to get center of parent form, not center of screen behavior. Passing in the parent form seems to only control the ownership of the window. These classes are sealed, so I do not see how I can do any WinProc tricks. Rewriting the classes is not an appealing option. Any other ideas?

推荐答案

正如HTH以上解释的,也有丑陋的方式去做。 下面是一个简单的类,将包裹对话框并居中在父应用程序/表格。

As HTH explained above, there are ugly ways to do it. Here is a simple class that will wrap the dialog box and center it in the parent application/Form.

这需要丑陋的方式和他们换到的东西稍微更简单。

It takes the ugly ways and wraps them to something slightly more simple.

虽然我还没有实现这样或真正钻研的来源,这是一个良好的开端。 $ C $的CProject CenterDialog

While I haven't implemented this or really delved into the source, it's a good place to start. CodeProject CenterDialog

希望这有助于。

这篇关于我可以定位.NET的(表格)消息框或通用对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆