+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Tutorial: C# Hello World

  1. #1
    Jordan Guest

    Tutorial: C# Hello World

    In this tutorial I will show you how to create the basic "Hello World" program using one form, a button and the messagebox class.

    1) Load up Visual Studio 2005 or Visual C# Express Edition.
    A. Click File/New Project
    B. Select Windows Application
    C. Type in the name of the project. I used "Hellow World"




    2) You should now have Form1 loaded into the IDE with panes to each side of the form. The next thing we are going to do is add a button. To add a button move your mouse over the toolbox which is a tab. This should be on the right hand side as a little tab. This location may be changed though. Refer to the next image if you can not find the tab.

    3) Once you see the new pane appear click on "button"




    4) Move your mouse over to Form1 in the center of your screen. Click and hold down the mouse button and drag the mouse to the desired dimensions of the button you want.



    5) Now that we have our button created we need to add our method to make the "Hello World" message appear. The easiest way to create this method is to simply double-click on the new button. Once you have double-clicked on "button1" you should have code that looks like this:

    Code:
     private void button1_Click(object sender, EventArgs e)
            {
    
            }
    5) In between the two brackets ( { and } ) add this code:

    Code:
    MessageBox.Show("Hello World");
    Your code should look like this:
    Code:
    private void button1_Click(object sender, EventArgs e)
            {
                MessageBox.Show("Hello World");
            }
    6) Press F5 to run your program. Once the program appears on the screen press button1 and a messagebox should appear.



    And that completes the tutorial. From here you can start to play around and change things like the text of the button by right-clicking on the button and selecting properties. A properties pane will appear on the right side of the IDE. Find the Text Field and change it from button1 to anything you like.

    I've attached an example of this tutorial as well. In order to download you must be a registered member.
    Attached Files Attached Files

  2. CODECALL Circuit advertisement

     
  3. #2
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Hmm I was going to make that in VB! I will make it tomorrow I think!

  4. #3
    Lop's Avatar
    Lop
    Lop is offline Speaks fluent binary
    Join Date
    May 2006
    Posts
    1,178
    Rep Power
    30
    Nice tutorial - very detailed. Rep Give!

    Tcm - I say make it man! Love your tutorials as well.

  5. #4
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Hmm thatnks for loving them but now school started and I dont have much free time!! sorry but will make em soon!

  6. #5
    Ronin is offline Programming Professional
    Join Date
    Apr 2006
    Posts
    309
    Rep Power
    24
    Very nice tutorial. This should help out the newbs.

  7. #6
    terabite's Avatar
    terabite is offline Newbie
    Join Date
    Nov 2006
    Location
    jamaica
    Posts
    14
    Rep Power
    0

    nice!!!....but

    im really interesting in your tutorial but i dont have visual studio 2005 nor visual c sharp xpress edition. ive seen visual studio 2005 for download but its very big....could u recommend some thing a little smaller that might be able to work with your tutorial...

  8. #7
    Paradine is offline Learning Programmer
    Join Date
    Oct 2006
    Posts
    48
    Rep Power
    0
    What type of connection are you on? I would recommend downloading VS Express Edition - just let it go all night if you are on a slow connection.

    Here is a list of Free C# Compilers that you may want to get:

    http://www.thefreecountry.com/compilers/csharp.shtml

  9. #8
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Hmm Im gonna try this coz im really interested in learning this language!! coz I think that VB nowadays isn't used so much, so ill try to switch languages slowly!

  10. #9
    Join Date
    Oct 2006
    Location
    Hendersonville, NC
    Posts
    1,700
    Blog Entries
    3
    Rep Power
    0
    Nice. Maybe ill get the program to just mess around


  11. #10
    Cosmet is offline Learning Programmer
    Join Date
    Oct 2006
    Posts
    58
    Rep Power
    0
    Might as well, it is free!

+ Reply to Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 9
    Last Post: 01-14-2011, 12:59 PM
  2. Visual Studio 2008: C# Hello World Tutorial
    By Jordan in forum CSharp Tutorials
    Replies: 32
    Last Post: 07-30-2010, 07:15 AM
  3. C/C++ Hello World Tutorial
    By Khaotic in forum C Tutorials
    Replies: 6
    Last Post: 07-28-2009, 08:35 AM
  4. [D] Hello World Tutorial
    By Termana in forum Tutorials
    Replies: 6
    Last Post: 01-09-2009, 03:10 PM
  5. Java:Tutorial - "Hello World"
    By John in forum Java Tutorials
    Replies: 20
    Last Post: 12-23-2008, 06:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts