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 是否可以将消息框按钮设置为没有默认按钮焦点?_Vb.net_Msgbox - Fatal编程技术网

Vb.net 是否可以将消息框按钮设置为没有默认按钮焦点?

Vb.net 是否可以将消息框按钮设置为没有默认按钮焦点?,vb.net,msgbox,Vb.net,Msgbox,是否可以将其设置为在出现messagebox时没有默认按钮焦点?这样,消息框将强制用户使用鼠标选择是或否。MessageBoxDefaultButton(如下所示)仅允许更改默认按钮,不提供选择无的选项 MsgBox("continue?", vbYesNo + vbQuestion, "Do you want to continue?", MessageBoxDefaultButton.Button1) 谢谢 通过组合MsgBoxStyle(MsgBoxStyle.YesNoCancel+M

是否可以将其设置为在出现messagebox时没有默认按钮焦点?这样,消息框将强制用户使用鼠标选择是或否。MessageBoxDefaultButton(如下所示)仅允许更改默认按钮,不提供选择无的选项

MsgBox("continue?", vbYesNo + vbQuestion, "Do you want to continue?", MessageBoxDefaultButton.Button1)

谢谢

通过组合MsgBoxStyle(MsgBoxStyle.YesNoCancel+MsgBoxStyle.DefaultButton2),在Vb.net Msgbox上设置默认按钮非常简单:

Visual Studio(VB,16.8.4)-如果您需要信息符号和“是”按钮,请尝试以下操作:-

MsgBox("Your message", vbQuestion + vbYesNo + MsgBoxStyle.DefaultButton1, "The MsgBox title")

编写您自己的简单表单窗口,您可以直接控制所有按钮行为。感谢您的建议。这正是我计划要做的,但我想首先确保没有更简单的修复方法。别忘了捕获键盘输入,否则用户只需在不使用鼠标的情况下点击按钮即可。@asawyer更简单,但设置
button.TabStop=False
不确定为什么要编辑我的原始代码DuDa,如果您将我的原始代码复制并粘贴到VisualStudio(VB)2019中,它就可以正常工作。请试一试。。
MsgBox("Your message", vbQuestion + vbYesNo + MsgBoxStyle.DefaultButton1, "The MsgBox title")