的MessageBox.show() [英] MessageBox.Show()

查看:180
本文介绍了的MessageBox.show()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想告诉我的消息框在它的父窗体的中心。如果我移动窗体,并显示消息框,它始终显示在桌面中央。我希望它出现与形式。 你能给我一些技巧和建议?

I would like to Show my Messagebox in the center of its parent form. if i move the form and show the messagebox, it always show in the center of the desktop. i want it to appear along with the form. Can you give me some tricks and advice?

推荐答案

要做到这一点,最好的方法是使用窗口钩子和中心消息框自己。有一个完美的一篇文章,显示了这种用法。

The best way to do this is to use Window Hooks and center the message box yourself. There is a perfect article which shows this usage.

您可以在这里找到: HTTP://www.$c$cproject.com/KB/dialog/CenterDialog的.aspx

You can find it here: http://www.codeproject.com/KB/dialog/CenterDialog.aspx

您还可以使用类在你的应用程序,而不潜水太深,了解它是如何工作的。

You can also use the class in your application without diving in too deep to find out how it actually works.

这篇关于的MessageBox.show()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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