473,382 Members | 1,107 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,382 software developers and data experts.

Really simple question on 'msgbox'

I'm a VB programmer, learning C#. How does one do the equivalent of a
"msgbox" (from Visual Basic) in C#? Is there something like this:
System.Forms.MessageBox("Hello World");
Thanks,
Marvin
Mar 22 '08 #1
1 1436
Hi Marvin,

On Sat, 22 Mar 2008 06:01:20 -0700 (PDT), CO*********@lycos.com wrote:
>I'm a VB programmer, learning C#. How does one do the equivalent of a
"msgbox" (from Visual Basic) in C#? Is there something like this:
System.Forms.MessageBox("Hello World");
Thanks,
Marvin
You almost guessed it alreadyt:

System.Windows.Forms.MessageBox.Show("Hello World");

(don't forget the semicolon :-)

Btw., don't worry - you won't have to retype that lengthy namespace, just add

using System.Windows.Forms;

at the top of your .cs file, if the "New Project" wizard did not do that for
you already.

Then, just use e.g.

MessageBox.Show("Hello World");

(There's lots of alternatives btw, if you are using Visual Studio, try opening
the curling brace after typing "Show" and srcoll through them with cursor up
and down)

Have fun with C#!

Regards,
Gilles.

Mar 22 '08 #2

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

Similar topics

7
by: r0adhog | last post by:
I have a very simple form: <html> <head> </head> <body> <% function ValForm() if len(document.form.newapp.all("AccessCode").Value) = 4 then document.form.newapp.submit()
9
by: Pete | last post by:
Does anyone have a simple html vbscript or other type of snippet they can share that appends a record to a access database via ADO or DAO? I would like to allow users that don't have Microsoft...
8
by: alsemgeest | last post by:
Hi, I'd like to make my own very simple autorisation system. Just a table: tblUsers (user and pw). Next I need a form with user and pw in textbox, with an OK button. If the lookup fails: msgbox...
6
by: Brian | last post by:
Hello, I am using a beginners book on VB .net and already stumped....when using this code (below) , it will tell me that MsgBox is not valid. This is a very simple program and I can't figure out...
11
by: Sehboo | last post by:
Hi, I want to write a very very simple mail application which my father can use (maybe then I will be able to send and receive emails from him). This application will have a text box, where he...
4
by: iwdu15 | last post by:
hi, im new to creating connections to different computers in VB, so i tried a simple program to connect with a different computer with my program on it. I enter in the target computer's IP address,...
12
by: RICHARD BROMBERG | last post by:
For the last couple of days I have been trying to learn how to solve this problem. I'm using Access 2000 I am posting it again and maybe I will be mofe successful. I have a text box and a...
4
by: ldpfrog | last post by:
This is my first tutorial, so if there are any mistakes please forgive me =). This will show you a very simple way to read your Login information from an outside text file. What you need: 1....
19
by: Jetean | last post by:
private void button4_Click(object sender, EventArgs e) { ConnectionStringSettings met = ConfigurationManager.ConnectionStrings; OleDbConnection...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.