将消息框相对于表单居中
我所采取的消息框出现在窗口的中心,但是有什么方法可以使它们出现在表单的中心。
The messagebox I have taken is appearing in the center of the windows but is there any way to make them appear at the center of the form.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您正在谈论标准
MessageBox
,并且希望它显示在调用它的Form
的中心,请尝试 此解决方案。请注意,您想要查看“Joe”的答案,而不是标记为答案的答案。我用过这个,它对我来说非常有效。
If you ARE talking about a standard
MessageBox
, and you want it to show in the center of theForm
that calls it, then try This Solution. Note that you want to look at the answer from "Joe" rather than the one marked as the answer.I've used this and it works great for me.
这是我自己用C# winform制作的消息框,除了实现中心父窗体外,还可以自定义按钮文字和图标。
This is my own message box use C# winform, In addition to the realization of the parent form in the center, can customize the button text and icon.