views:

65

answers:

1

'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!!

A: 

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.

klabranche
Okey, How to make sure the message box is top most with MessageBox of System.Windows.Forms. Sometimes, the message box displayed behind the window/form.
Vin
Thanks, With your approach of using MessageBoxOptions of DefaultDesktopOnly also the message box shows up in the windows taskbar. How to avoid this?
Vin
This fixes it so that it forces it to show on top now but You don't want the messagebox to show in the windows taskbar?
klabranche
Yes, I don't want the messagebox to show in the windows taskbar.
Vin
I added a bit on my answer.... Hopefully that will get you working.
klabranche