如何在vb.net中创建消息框 [英] how to create message box in vb.net

查看:100
本文介绍了如何在vb.net中创建消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在vb.net中工作,我不知道如何使用消息框以及为什么我们使用参数 pls向我解释

I am working in the vb.net i don''t know how to use message box and why we use parameters pls explain me

推荐答案

尝试:
MessageBox.Show("This is what happened")





MessageBox.Show("This is what happened", "This is what you tried to do")





MessageBox.Show("This is what happened", "This is what you tried to do", giveHimTheseButtons)





If MessageBox.Show("This is what happened", "This is what you tried to do", MessageBoxButtons.YesNo) = DialogResult.Yes Then
   ...
End If


有两种方法在VB.NET中创建消息框

1.过去的学校方式.我建议您不要使用它. (只是为了让您知道而向您展示)

there are 2 ways to create messageboxes in VB.NET

1. The old school way. I advise you not to use this. (just showing you for the sake of letting you know)

MsgBox("This is a message", vbOKOnly, "Title")



第二个(按钮样式)和第三个(标题)参数是可选的.


2.这是显示消息框的首选方法.



the 2nd (button style) and the 3rd (caption) parameters are optional.


2. This is the preferable way to show a messagebox.

MessageBox.Show("This is a message", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information)



第2个(标题),第3个(按钮样式)和第4个(图标)是可选的.



the 2nd (caption), 3rd (button style) and the 4th (icon) are optional.


请参阅此链接,以了解不同的消息框
http://www.dotnetperls.com/messagebox-show-vbnet [
See this link, for Different message boxes
http://www.dotnetperls.com/messagebox-show-vbnet[^]

Thanks
--RA


这篇关于如何在vb.net中创建消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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