Want to start learning C#

If your a member of codenstuff then this is the main place to be. Get together..talk..chat and ponder. Have fun. Chill out. Play games.
8 posts Page 1 of 1
Contributors
User avatar
Skillful
Skillful Coders
Skillful Coders
Posts: 969
Joined: Tue Nov 16, 2010 10:07 am

Want to start learning C#
Skillful
Hey guys I want to start learning C# from scratch.
Can you guys recommend me how and from where do I start?
I have Visual C# Express Edition installed.
Instead of LOL use this -
LSIBMHBIWFETALOL

Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: Want to start learning C#
CodenStuff
Well you have C# installed so thats a good start lol.

Just do as you did with VB and read through tutorials to pick up the syntax to learn how to use it. A good way to see the differences between how you code something in VB and how to do that in C# is to use a convertor like: http://www.developerfusion.com/tools/co ... to-csharp/

For example heres a few common things in VB:
Code: Select all
Dim Picture as bitmap  = my.resources.horse
Picturebox1.image = Picture

For i = 0 to 100
Label1.text = i
next i

msgbox("Hello World")
And this is how it looks when converted to C#:
Code: Select all
bitmap Picture = my.resources.horse;
Picturebox1.image = Picture;

for (i = 0; i <= 100; i++) {
	Label1.text = i;
}

Interaction.MsgBox("Hello World");
You just have to read up on it and try things out cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Re: Want to start learning C#
MrAksel
Sorry Craig, but that is wrong. Conversions in C# are very strict, so you have to use i.ToString() in the for loop. And it is reapply important to remember that C# is case sensitive.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
Zulf
Serious Programmer
Serious Programmer
Posts: 441
Joined: Fri Jun 11, 2010 7:46 am

Re: Want to start learning C#
Zulf
Code: Select all
Bitmap picture = Image.FromFile("/horse.png");
pictureBox1.Image = (Image)picture;

for (i = 0; i <= 100; i++) {
   label1.Text = i.ToString();
}

MessageBox.Show("Hello World!");
Is correct. It's better to load images from an external directory. Saves resources and the program loads slightly faster.
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: Want to start learning C#
CodenStuff
Yeah yeah yeah I was just giving an example of the convertor lol
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Re: Want to start learning C#
MrAksel
Since Bitmap is derived from Image you do not need a cast to set the picturebox's image.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Want to start learning C#
Axel
Noone eff'in cares...
http://vagex.com/?ref=25000
User avatar
Cheatmasterbw
Coding God
Coding God
Posts: 1506
Joined: Fri Jan 01, 2010 2:30 pm

Re: Want to start learning C#
Cheatmasterbw
C# isn't all that different from VB. The major difference is in things like variable declaration, If statements, case sensitivity, and syntax.

Message Boxes:
Code: Select all
'VB'
msgbox(...)
'or'
messagebox(...)
Code: Select all
//C#
messagebox.show(...);
If Statements:
Code: Select all
'VB'
If (...) Then
    (...)
End If
Code: Select all
//C#
if (...)
{
    (...)
}
Variable Declaration:
Code: Select all
'VB'
Dim X as Integer = 5
Dim Y as String = "ASDF"
Dim Z as Boolean = true
Code: Select all
//C#
int X = 5;
string Y = "ASDF";
bool Z = true;
http://www.megaapps.tk/
8 posts Page 1 of 1
Return to “Codenstuff boardroom”