Some Basic C# Help (To be updated over the next two months)

Talk about your favorite PC games, Steam and building awesome custom rigs!

Moderator: Moderators

Post Reply
Kurt_
Portablizer
Posts: 5748
Joined: Thu Nov 24, 2005 10:32 am
Steam ID: kurbert
Location: Ontario, Canada
Contact:

Some Basic C# Help (To be updated over the next two months)

Post by Kurt_ »

Well, long story short, I'm taking a class where we program basic stuff in C#. However, I don't speak C# very well, I speak VB6. Luck for me, I know kind of what to look for, and know how to code, I just don't know nomenclature/syntax.

So, over the course of the course, I'll need little tidbits of help on how to do things.

1) What is the code for a delay?
Example:

Code: Select all

While(true)
{
lbl1.BackColor = Color.Red;
DELAY(200);
lbl1.BackColor = Color.Blue;
DELAY(200);
}
2) What is the code to complete the following "if" statement?
Example:

Code: Select all

if (the value in txtbox1 is not a number) 
{
do this;
}
else
{
do that;
}
It doesn't like my else statements, and I'm not sure what to put after the 'if' to check that a number has been entered into the textbox. Another alternative is to convert the letter/character to a number, another thing I only know how to do in VB6.
Hey, sup?
ghosstt
Senior Member
Posts: 1551
Joined: Mon Feb 26, 2007 4:14 pm

Post by ghosstt »

You realize MSDN has all of this ready for you right? You type what syntax/structures your using, and it gives you the code in VB6, VB.net, C#, C++, JS.net(or something), etc. It explains every variable entry and every part of the code.
Kurt_
Portablizer
Posts: 5748
Joined: Thu Nov 24, 2005 10:32 am
Steam ID: kurbert
Location: Ontario, Canada
Contact:

Post by Kurt_ »

Yeah, but would it kill you to just type it here while I do more important stuff? :D
Hey, sup?
Post Reply