Lost Password?

  #1 (permalink)  
Old 09-23-2006, 01:58 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Age: 26
Posts: 5,942
Last Blog:
Performance or Maintai...
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default 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 To view attachments your post count must be 1 or greater. Your post count is 0 momentarily.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 09-23-2006, 02:04 PM
TcM's Avatar   
TcM TcM is online now
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 7,329
Rep Power: 66
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default

Hmm I was going to make that in VB! I will make it tomorrow I think!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-26-2006, 08:42 AM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,135
Rep Power: 16
Lop is on a distinguished road
Default

Nice tutorial - very detailed. Rep Give!

Tcm - I say make it man! Love your tutorials as well.
__________________
Lop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-26-2006, 01:33 PM
TcM's Avatar   
TcM TcM is online now
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 7,329
Rep Power: 66
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default

Hmm thatnks for loving them but now school started and I dont have much free time!! sorry but will make em soon!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-28-2006, 07:54 AM
Ronin Ronin is offline
Programming Professional
 
Join Date: Apr 2006
Posts: 299
Rep Power: 10
Ronin is on a distinguished road
Default

Very nice tutorial. This should help out the newbs.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 11-21-2006, 10:56 AM
terabite's Avatar   
terabite terabite is offline
Newbie
 
Join Date: Nov 2006
Location: jamaica
Posts: 14
Rep Power: 0
terabite is on a distinguished road
Default 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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-21-2006, 11:17 AM
Paradine Paradine is offline
Learning Programmer
 
Join Date: Oct 2006
Posts: 48
Rep Power: 7
Paradine is on a distinguished road
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 11-21-2006, 11:19 AM
TcM's Avatar   
TcM TcM is online now
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 7,329
Rep Power: 66
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 11-22-2006, 01:14 AM
xXHalfSliceXx's Avatar   
xXHalfSliceXx xXHalfSliceXx is offline
Co-Administrator
 
Join Date: Oct 2006
Location: Hendersonville, NC
Age: 24
Posts: 1,161
Rep Power: 20
xXHalfSliceXx is on a distinguished road
Send a message via AIM to xXHalfSliceXx Send a message via MSN to xXHalfSliceXx Send a message via Yahoo to xXHalfSliceXx
Default

Nice. Maybe ill get the program to just mess around
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Company
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 11-28-2006, 08:24 AM
Cosmet Cosmet is offline
Learning Programmer
 
Join Date: Oct 2006
Posts: 58
Rep Power: 7
Cosmet is on a distinguished road
Default

Might as well, it is free!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
World of Warcraft: Wrath of the Lich King Onur Video Game Talk 25 07-13-2008 02:05 AM
John's Java Tutorial Index John Java Tutorials 0 01-11-2007 03:05 PM
Tutorial to Remove the Virus "Trojan horse Startpage.ADE" clookid Tutorials 9 01-09-2007 09:39 PM
JSP Tutorial encoder JavaScript and CSS 0 05-26-2006 05:31 AM


All times are GMT -5. The time now is 03:00 AM.

Contest Stats

John ........ 223.00000
dargueta ........ 168.00000
Xav ........ 164.00000
LogicKills ........ 20.00000
gaylo565 ........ 18.00000
WingedPanther ........ 15.00000
|pH| ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 67%

Ads