MSgBox in VB.Net 2005

  • Thread starter Thread starter ats@jbex
  • Start date Start date
A

ats@jbex

I am currently working on an application in VB.Net 2005. One of the things
I want is a message box like I used to use in standard VB. e.g. In VB6 I
could write the following:

msgbox "Some text", vbOkCancel + vbQuestion, ApplicationName

How do I use to MsgBoxStyles in VB.Net 2005?

TIA

--
ats@jbex

No mercy for what we are doing
No thought to even what we have done
We don't need to feel the sorrow
No remorse for the helpless one

Metallica - No Remorse
 
ats@jbex said:
I am currently working on an application in VB.Net 2005. One of the
things I want is a message box like I used to use in standard VB.
e.g. In VB6 I could write the following:

msgbox "Some text", vbOkCancel + vbQuestion, ApplicationName

How do I use to MsgBoxStyles in VB.Net 2005?


MsgBox( _
"Some text", MsgBoxStyle.OkCancel Or MsgBoxStyle.Question, _
ApplicationName _
)

- or -

MessageBox.Show( _
"Some text", ApplicationName, MessageBoxButtons.OKCancel, _
MessageBoxIcon.Question _
)


Armin
 
This is very similar :
MsgBox("Message", MsgBoxStyle.OkCancel Or MsgBoxStyle.Information,
"Title")

What have you tired that doesn't work (in VB.NET enums are using the enum
name whihc cas optional in VB6).

Also you have the .NET form :

MessageBox.Show("Message", "Title", MessageBoxButtons.OKCancel,
MessageBoxIcon.Information)

which cleanly separates each settings...

Thanks for your prompt response I tried the same as I would in VB6!! I will
try your 2 methods now.
--
ats@jbex

The world is my expense
The cost of my desire
Jesus blessed me with its future
And I protect it with fire

Rage Against The Machine - Sleep Now In The Fire
 
MsgBox( _
"Some text", MsgBoxStyle.OkCancel Or MsgBoxStyle.Question, _
ApplicationName _
)

- or -

MessageBox.Show( _
"Some text", ApplicationName, MessageBoxButtons.OKCancel, _
MessageBoxIcon.Question _
)


Armin

Thanks for the reply. I am trying them now.
--
ats@jbex

Every year is the same
And I feel it again,
I'm a loser - no chance to win

The Who - I'm One
 
Back
Top