{
for (int i = 0; i < listBox1.Items.Count; i++){
MessageBox.Show(listBox1.Items}
AND/....................
{
for (int i = 0; i < listBox1.Items.Count; i++) MessageBox.Show(listBox1.Items{
}
}
}
between curlies and not....this could drive me insane.
Thanks!

Curley Crazy {
XIU
If you are transitioning from VB.NET, you can think of the curly brackets as start and end of blocks.
For example, in VB.NET
If val1 > val2 Then
'do something
'do something else
End If
Would be written as:
if (val1 > val2)
{
//do something
//do something else
}
Notice the curly brackets should always be written after a statement. The final curly bracket in a block would go in the same place you'd but an End If, End, Next, Wend, etc. in VB.NET.
Hope this helps,
Josh Lindenmuth
abarone
you will notice the difference if you for Example execute 2 methods in your for loop.
for (...)
{
method1();
method2();
}
both methods will be executet in the for-loop.
for (...)
method1();
method2();
only method1 will be executet in the for-loop. method2 will be executed after the loop.
Thats the trick ;)
Hibri
so the } is like and exit for (VB)...
RyanK
I just went thru the 8 hours of Microsoft Absolute Newbie videos.
They really did cover mucho , mucho...
However...when a new concept was introduced...loops, if etc....the code was always pasted. Now I know why.
Nobody could do it live (lol)...and Im sure Microsoft wanted to help end the well known brace crazies. It won't happen.
Thanks again.
iskander.sierra