MSgBox in VB.Net 2005

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
 
A

Armin Zingler

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
 
A

ats@jbex

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
 
A

ats@jbex

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dates 3
XML 2
File types 4
Dataset 2
Winsock 6 control in VB.NET 6
Classes in VB.Net 2
New features in vb.net 2005 8
Click ok to MessageBox in vb.net triggers form.activate in calling form 4

Top