views:

125

answers:

3

Earlier my code was running nicely.. then I edited some .. did not touch the designer code.

alt text

Why this error is being shown?

A: 

Maybe its the label is Null and that's causing the trouble. I'm not that experienced with C# but it could be the case that Controls doesn't except a Null-Pointer.

das_weezul
I am sorry. I made one variable called Controls (ArrayList)... extreamly sorry.
Rahul2047
A: 

Looks like, at this point in code label1 is not yet initialized. Whic event handler are you coding this in ? Make sure controls are initialized before using them. Make sure you are using the controls after InitComplete event.

isthatacode
I am sorry. I made one variable called Controls (ArrayList)... extreamly sorry.
Rahul2047
+1  A: 

If this is Windows Forms - did you remove the InitializeComponent() line from the form's constructor?

Stuart Dunkeld
I am sorry. I made one variable called Controls (ArrayList)... extreamly sorry.
Rahul2047