An unhandled exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
Additional information: Value cannot be null.
for this:
var flags = uint.Parse((string)checkedRadioButton.Tag, System.Globalization.NumberStyles.HexNumber);
An unhandled exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
Additional information: Value cannot be null.
for this:
var flags = uint.Parse((string)checkedRadioButton.Tag, System.Globalization.NumberStyles.HexNumber);
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amit MohantyPosted Feb 8, 2024, 5:52 AM
The issue is occurring because checkedRadioButton is null, meaning no radio button is currently checked in the groupBoxRegistrationFlag.Controls collection.
You should check if checkedRadioButton is not null before attempting to access its properties.
NaveenPosted Feb 8, 2024, 5:24 AM
Hi Yogi,
RadioButton checkedRadioButton = groupBoxRegistrationFlag.Controls.OfType().FirstOrDefault(r => r.Checked);
var flags = uint.Parse((string)checkedRadioButton.Tag, System.Globalization.NumberStyles.HexNumber);
check this.
Thanks!
Yogi SPosted Feb 8, 2024, 5:15 AM
The flags variable did not find checkedRadioButton so you get this error. Put breakpoint and see the full message and post it here so that we can understand more on it.