vb.net - 形式光标不变
问题描述
在一个 sub 中,我检查了一些值并打开了一个 MsgBox,默认情况下它会在我的表单之外弹出。关闭 MsgBox 后,我想将表单的光标更改为“Cursors.WaitCursor”。在 MsgBox 中单击“确定”后,鼠标位置在我的表单之外,我希望当我将鼠标移动到表单中时表单光标会变为 WaitCursor。但是光标没有改变。
MsgBox() 'is positioned outside the form by default
Application.DoEvents
Me.Cursor=Cursors.WaitCursor 'After closing MsgBox, the form gets back the focus, so "Me" should
'refer to the appropiate thread
Application.DoEvents
DoSomething for 20secs
Me.Cursor=Cursors.Default
删除“Application.DoEvents”不会显示任何效果。当我用鼠标将打开的 MsgBox 移动到表单中并单击“确定”时,表单的光标按预期更改为 WaitCursor。
我不想在打开 MsgBox 之前设置光标(因为按下 Cancel 应该立即退出 sub,并且我不想将光标设置回默认值)。(我也不想在我的表单中放置 MsgBox)有人知道发生了什么吗?提前谢谢。维尔纳
解决方案
推荐阅读
- ibm-doors - 批量使用 ibm-doors 中的元音变音或特殊字符
- javascript - 将光标移动到 Intellij Idea 或 Visual Studio Code IDE 中最近的特定符号
- javascript - 如何仅使用 JavaScript/Ajax 使用匹配的下拉选项执行文本框搜索
- ruby-on-rails - 使用不同的文件名附加 ActiveStorage blob
- java - 在 java 中生成 4 位字母数字序列的框架逻辑需要帮助
- linux - 如何在没有 Snap 的情况下创建 Linux 应用程序?
- php - 在 Laravel 中为 Excel 文件添加密码
- ios - 应用程序终止时运行代码。Xcode 12
- linux - chromeos 架子如何确定 linux 应用程序是否正在运行?
- linux - 使用 bash 查找文件的不同开头