473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to use MsgBox ?

Hi all,

C#.
I create form with single button.
On button push I want to get MsgBox("Hello world").
What I should do to make compiler understand "MsgBox" ?

regards
pronto
Nov 16 '05 #1
5 28509
Pronto,

MsgBox is a VB function, not a .NET function. In order to get the same
functionality, call the static Show method on the MessageBox class in the
System.Windows.Forms namespace.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"pronto" <pr****@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP10.phx.gbl...
Hi all,

C#.
I create form with single button.
On button push I want to get MsgBox("Hello world").
What I should do to make compiler understand "MsgBox" ?

regards
pronto

Nov 16 '05 #2
pronto wrote:
Hi all,

C#.
I create form with single button.
On button push I want to get MsgBox("Hello world").
What I should do to make compiler understand "MsgBox" ?

regards
pronto


using System.Windows.Forms;

MessageBox.Show("Here is your answer...");
Jamie
Nov 16 '05 #3
The best way to use it is to forget it exists ;-)
MessageBox.Show("Whatever");

--
W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
"pronto" <pr****@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP10.phx.gbl...
Hi all,

C#.
I create form with single button.
On button push I want to get MsgBox("Hello world").
What I should do to make compiler understand "MsgBox" ?

regards
pronto

Nov 16 '05 #4
MessageBox.Show("messagestring");

"pronto" <pr****@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP10.phx.gbl...
Hi all,

C#.
I create form with single button.
On button push I want to get MsgBox("Hello world").
What I should do to make compiler understand "MsgBox" ?

regards
pronto

Nov 16 '05 #5
Interestingly, MessageBox.Show was modelled on VB's MsgBox. If you
examine the parameters and the possible enum values - they correspond
almost one-to-one with VB's MsgBox.

So, it's not that VB's version is so horrible - it's just that .NET
has a virtually identical version, so you might as well use it. But
I'm willing to bet that under the covers you have the *identical*
.net framework code.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Bassett | last post by:
In my ASP script I call Javascript for a msgbox after the user has submitted the form of their resume information. I saw this example as a way to get a msgbox onto the client from ASP since server...
3
by: JT | last post by:
im trying to use the MsgBox function in the following to display an ASP MsgBox containing text retrieved from the db into a recordset <% set rsMessages= myRecordset msg_text =...
2
by: js | last post by:
Hi all, I currently encounter a problem and it is urgent to me. After calling the MsgBox.Show(), the message box is shown with non-modal mode, what is the possible reason??? This only happen...
4
by: Lakrom | last post by:
Hi to all, how to put msgbox in this asp page, this send me a message Denied permission: 'MsgBox' <% Set Conn=server.createobject("ADODB.connection") Conn.open application("StrConRuta") set rs =...
6
by: Lapchien | last post by:
In this bit of code provided so helpfully by Nath: Private Sub Command118_Click() Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.openrecordset("IMPORT")
8
by: deko | last post by:
Can I close a MsgBox with VBA Code? Something like: If IsOpen (MsgBox, "Title") Then Close(MsgBox, "Title") Run some code Else Run other code End If Can this be done in VBA? Do I need to...
2
by: Radith Silva | last post by:
I need to use the MsgBox function like I used to in VB 6.0 So all i do is: MsgBox ("Please provide Input") BUT IN .NET: The error reads "msgbox is a namespace"
4
by: James | last post by:
What does this mean? 'To specify more than the first argument, you must use the MsgBox function in an expression' I'd love to see an example. Thanks!
9
by: Ivan Jericevich | last post by:
In my code below at the line 'response' a blip sound is heard and the program exits the sub -- No MsgBox is displayed. What am I doing wrong? If nonNumberEntered = True Then msg = "Enter...
2
by: perkykoala | last post by:
I apologize in advance for being REALLY detailed/verbose. It's the result of staring/tweaking code for too long. Using VB 2005: I need to design a multiple choice test (unfortunately, I can't...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.