Hi everyone,
I have a problem about listBoxes. In my project there are two listBoxes. I do update, add,delete,clean operations on these ListBoxes. There is no problem with one of them but the other gives,
An unhandled exception of type 'System.NullReferenceException' occurred in PresentationFramework.dll
Additional information: Object reference not set to an instance of an object
error, with same codes.
For example when i want to clear all items in listBox, i do ;
lboxCity.Items.Clear(); and it gives the error mentioned above.
When i debug the code i recognize that after the code lboxCity.Items.Clear();
compiler goes
private void lboxCity_SelectionChanged(object sender, SelectionChangedEventArgs e){}
an do the operations inside.
Also I tried the same debug in running listBox.
After the code
lboxRegion.Items.Clear(); compiler does not run the function
private void lboxRegion_SelectionChanged(object sender, SelectionChangedEventArgs e)
These are just my observation, i am not sure where is the problem.
If it is not clear please note
Summary, while operating listbox operations, it gives nullReferencesException.