[Solved] How can I check if my color value is equal to Null

It seems that when you don’t select a color from the colorpicker, that the colorpicker.SelectedColor is null, and causing your error. You can check for this in your code, like so: private void btnreturn_Click(object sender, RoutedEventArgs e) { int gettext; int.TryParse(txtcount.Text, out gettext); Color Colorpicker; // Check if the SelectedColor is not null, and do … Read more