Issue with Microsoft.VisualBasic.Interaction.MsgBox method

雨燕双飞 提交于 2019-12-25 00:37:49

问题


'Microsoft.VisualBasic.Interaction.MsgBox' method always brings up windows taskbar when any message is displayed. How to fix this issue? I want the message to be the top most but windows taskbar shouldn't be visible.

Appreciate your help!!


回答1:


Is there a reason why you are using Microsoft.VisualBasic.Interaction.MsgBox? I would avoid using the Microsoft.VisualBasic library as much as possible. It's mainly there for backward compatibility. Almost everything in Microsoft.VisualBasic has been replaced in the .Net Framework elsewhere.

For example the MessageBox is now in System.Windows.Forms.

To force it on top always..... try the MessageBoxOptions of DefaultDesktopOnly

or this little code project sample.

To hide the message box from the windows task bar you might need to pass in the form you are calling the message box from in the call to Show (owner parameter). If the message box doesn't have an owner it will display on the task bar as it's own form.



来源:https://stackoverflow.com/questions/3721540/issue-with-microsoft-visualbasic-interaction-msgbox-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!