Professional Documents
Culture Documents
Help
Remember Me?
Forum
Today's Posts
FAQ
Calendar
Community
Groups
My Albums
Member List
Spy
Forum Actions
Quick Links
Blogs
Recent Activity
Unanswered
Search
Features
Live!
Youtube Channel
Books
Subscriptions
RSS
Submit Tutorials
FAQ
Contact Us
guest process
Advanced Search
Forum
Software Development
Tutorials
CSharp Tutorials
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have
to register before you can post: click the register link above to proceed. To start viewing
messages, select the forum that you want to visit from the selection below.
Want to harness your programming skill and turn it into absolute prowess? Come join our
programming events! Current Event
+ Reply to Thread
35309e0ba68f77 6267
Page 1 of 4 1 2 3 ... Last
Go
Jump to page:
Results 1 to 10 of 33
LinkBack
LinkBack URL
About LinkBacks
Bookmark in Technorati
Thread Tools
Search... Search
Advanced Search
vBForum_Post
Display
Linear Mode
01-30-2008 02:38 PM #1
Jordan
Guest
In this VS 2008 tutorial I'll show you how the Visual Studio IDE works using C#. In the end you
will create a program that displays the traditional "Hello World" message.
Once all of the initialization has finished you will see the Visual Studio 2008 Start Page pictured
below.
In the left column you can see the Solution Explorer and a tab at the bottom labeled Class
View.
Solution Explorer
Solution Explorer provides you with an organized view of your projects and their files as well as
ready access to the commands that pertain to them. A toolbar associated with this window
offers commonly used commands for the item you highlight in the list. To access Solution
Explorer, select Solution Explorer on the View menu.
Source
Class View
Class View displays the symbols defined, referenced, or called in the application you are
developing. You can open Class View from the View menu. There are two panes: an upper
Objects pane and a lower Members pane. The Objects pane contains an expandable tree of
symbols whose top-level nodes represent projects. To expand a node selected in the tree, click
its plus (+) sign or press the plus (+) key on the keypad.
Icons identify hierarchical structures employed within your projects, such as namespaces,
types, interfaces, enums, and classes. You can expand these structures to list their members.
Properties, methods, events, variables, constants, and other contained items are listed in the
Members pane.
This hierarchical, project-by-project, view clarifies the symbolic structures within your code.
You can use Class View to open files and navigate directly to the lines where symbols appear.
Source
On the Right..
You can see the Properties Window and two tabs, Toolbox and Server Explorer (these tabs are
vertical along the upper right hand corner). The properties window displays sizes, dimensions
and other "properties" for objects. The Toolbox tab is where you select components and add
to your form. For a more in depth guide on using the IDE I suggest you pick up a good book or
even take a class.
The first thing you should do is name your form appropriately. Find (Name) in the properties
window (you may need to scroll) which should have a value of Form1. Change the value to
frmMain. Preceding the names of your objects with what they are (frm = form) will create
legible, clean code that is easy to read when you edit your code 1 month later. In this tutorial
all objects will have a preceding name which specifies what they are.
The 2nd thing you should change is the text of your form which currently states Form1. The
text label is simply the "title" of your form. Scroll down (or up) in the properties view until you
find Text with a value of Form1. Change the value to "Hello World".
Adding functionality
Mouse over the Toolbox tab on the right hand side to view the objects you can use:
Click on Button. Place your mouse cursor over the center of your form (frmMain), left-click and
hold. Move your cursor to the right and bottom to create a square. Release the mouse button.
You should now see a button in the center of your screen with the Text/Title of Button1.
You have now created a button and properly named/labeled it. The next step is adding the
code that makes it work. Double click the button (btnHelloWorld) in the center of your form.
This actually creates the button click event function and brings up the code window.
Your cursor is directly below the opening curly bracket { and directly above the closing
bracket }. The first thing you should do when a new function is created is comment the code.
The Visual Studio 2008 IDE has built in functions that assist you in this task. Press the up arrow
three times. Press Enter once. Now press the forward slash (/) three times. As you left of the
forward slash the third time XML comments are created for entering function data. Your cursor
will be between the summary tags. Enter here what the function below will do. Our function
will create a message box with the text "Hello World". Hence, enter:
Code:
///<summary>
/// </summary>
Notice as you press enter three new forward slashes (/) are entered automatically and your
cursor is indented to the correct place. This is one of the great features of the VS IDE,
automatic indention. You may not appreciate it much now but if you ever do work in Notepad
or a similar non programming text editor you will learn how much it helps.
Your cursor should be just below the opening bracket { and just above the closing bracket }.
Type MessageBox.Show("Hello World");. Notice the autofill drop down that appears. Another
feature of the Visual Studio suite that you will find very useful in time. As you type functions
are highlighted in this autofill, pressing enter before you finish typing will automatically fill the
text in for you.
MessageBox Function
Displays a modal dialog box that contains a brief application-specific message, such as status or
error information. The message box returns an integer value that indicates which button the
user clicked.
Source
Choose either of the options and your code will be compiled and ran.
Congratulations!
You've created your first Visual Studio 2008 C# Program. You've learned some of the very
basics here in this tutorial and I highly recommend getting a Visual Studio 2008 C# Book. If you
have any questions or comments please post them here.
Attached Files
CODECALL
Circuit advertisement
02-27-2008 05:48 AM #2
eseph
Newbie
Join Date
Feb 2008
Posts
Thanks
Hello World.
08-21-2008 10:34 PM #3
srbworld
Newbie
Join Date
Aug 2008
Posts
Thanks
Thanks a lot.
08-21-2008 10:43 PM #4
gaylo565
Programming Professional
Join Date
May 2007
Location
flagstaff, az
Posts
268
Thanks
08-22-2008 08:44 AM #5
Xav
Join Date
Mar 2008
Location
Posts
13,175
Blog Entries
13
Thanks
When you consider how long it is, the code is kinda basic, but of course this was the point.
Well done, +rep.
Good members, like yourself, stick around and post for ages to come!
tianhui
Newbie
Join Date
Nov 2008
Posts
Thanks
it is easy to understand
11-04-2008 08:33 AM #7
WingedPanther
Join Date
Jul 2006
Age
37
Posts
14,113
Blog Entries
61
Thanks
11-04-2008 09:04 AM #8
Jordan
Guest
I suppose this one is just getting popular? It seems it has created several linkbacks from Yahoo
and Kizmo. If anyone needs further assistance just let me know.
Reply With Quote
11-17-2008 08:11 PM #9
glowinggem888
Newbie
Join Date
Nov 2008
Posts
Thanks
11-18-2008 03:07 PM #10
pavonia
Newbie
Join Date
Nov 2008
Posts
Thanks
BTW, is it possible to provide a tutorial describing, how to create a new Web project in
VS2008, like this Hello World program?
Like user will go to some URL, provide ID/Password and for successful log-in, he/she will get
"Hello <User Name>" message.
Thanks again.
+ Reply to Thread
35309e0ba68f77 6267
Page 1 of 4 1 2 3 ... Last
Go
Jump to page:
Thread Information
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
Replies: 5
Replies: 2
Replies: 1
Replies: 0
Replies: 1
studio
tutorial
visual
world
Bookmarks
Bookmarks
Digg
del.icio.us
StumbleUpon
Posting Permissions
BB code is On
Smilies are On
[IMG] code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Rules
Principio del formulario
Contact Us
Archive
Privacy Statement
Top
All times are GMT -8. The time now is 08:03 AM.