Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net visual studio中的msgbox按钮类型_Vb.net_Visual Studio 2010_Visual Studio - Fatal编程技术网

Vb.net visual studio中的msgbox按钮类型

Vb.net visual studio中的msgbox按钮类型,vb.net,visual-studio-2010,visual-studio,Vb.net,Visual Studio 2010,Visual Studio,如何设置具有“确定”和“取消”等按钮的消息框?我们还可以为按钮命名自己的名称吗?我们可以为这些按钮编写源代码吗 ok.click, form1.show() and if cancel.click form5.show() msgbox() 您可以使用enum在messagebox上指定不同类型的按钮,并在单击按钮后使用,为每种类型的messagebox按钮指定不同的操作。 或者试试这个: MessageBox.Show("put your text here", "here the titl

如何设置具有“确定”和“取消”等按钮的消息框?我们还可以为按钮命名自己的名称吗?我们可以为这些按钮编写源代码吗

ok.click, form1.show() and if cancel.click form5.show()
msgbox()
您可以使用enum在messagebox上指定不同类型的按钮,并在单击按钮后使用,为每种类型的messagebox按钮指定不同的操作。 或者试试这个:

MessageBox.Show("put your text here", "here the title of you message", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand)
在第二个逗号[,]之后,您可以放置按钮类型,最后您可以放置您认为最适合您的消息框的图标

关于

这应该是可行的:

If (MsgBox("Your Text", MsgBoxStyle.OkCancel, "MessageBox Title") = MsgBoxResult.Ok) Then
        Form1.Show()
    Else
        form5.show()
    End If

这是一个简单的消息框:

If MessageBox.Show("some msg", "caption", MessageBoxButtons.OKCancel) = DialogResult.Cancel Then
    ' you cancel it, so i will show another message box
EndIf