Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy Question.....VERY NEWBIE HERE! 1

Status
Not open for further replies.

smeeks

Programmer
Oct 7, 2003
31
US
I am trying to do a "Hello World" in C#....when I open a blank project.....put a button on the form....and under the click event I am typing in Messagebox.Show. First of all intellisense doesn't recognize it and when I build I get the following error:

The type or namespace name 'messagebox' could not be found (are you missing a using directive or an assembly reference?)

I searched for this error on the Internet but didn't have much luck so I assume I am an idiot!

Is there something I need to do when I start a new C# project? This seemed very very basic to me.

thanks,

C# Very Newbie
 
C# is case sensitive. Are you typing it in all lower case?

Also, make sure you have the "using System.Windows.Forms;" declared in your coding page. It should already be there if you created a windows forms project, but just make sure.

I'm almost willing to bet it's a case sensitivity issue, though.

______________________________________________
When told, "goto hell", a programmer finds the method, not the destination as harmful.
 
hi
As Sacheson said C# is case sensitive. To use a MessageBox Class and the Show method, All you need to do is declare your box as:


MessageBox.Show("Hello World");

Hope it works.

- Another C# Newbie :)
 
Yep. I have been using VB for so long and I have only used C on a unix system....so since I was using the .NET IDE I just assumed it would act the same as VB....but guess not. That was my problem though...I was typing it in lower case.

thx.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top