|
||||||
| CSharp Tutorials Tutorials for C# |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
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)
{
}
Code:
MessageBox.Show("Hello World");
Code:
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello World");
}
![]() 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.
__________________
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! |
| Sponsored Links |
|
|
|
|||
|
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 |
|
|||||
|
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 ![]() |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |
| 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 |
Goal: 100,000 Posts
Complete: 67%