Reputation: 1595
Earlier my code was running nicely.. then I edited some .. did not touch the designer code.
alt text http://img718.imageshack.us/img718/3759/errorstack.jpg
Why this error is being shown?
Upvotes: 0
Views: 1090
Reputation: 1641
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.
Upvotes: 0
Reputation: 73243
If this is Windows Forms - did you remove the InitializeComponent() line from the form's constructor?
Upvotes: 1
Reputation: 6142
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.
Upvotes: 0