Ok, I have a very simple question:
I did not have option strict turned on in one of my forms, and now that it is I have an error saying that you can't convert an integer value to a checkbox checkstate value. I thought these were the same thing?
I am reading through a file with a bunch of 1's and 0's in it that saves the checkstate of different checkboxes between program executions, and those values were written by reading the checkstate of the checkboxes when the program closed the last time.
'this is the line that gives me problems with option strict on
chkIncludeSampleNumber.CheckState = CInt(temp) ' where temp is a string, either 1 or 0
with option strict off this line worked just fine checking or leaving the checkbox blank, but I want it to be right.
Does that mean I have to do this or is there a better solution:
if temp = "1"
chkIncludeSampleNumber.CheckState = checkstate.checked
else
chkIncludeSampleNumber.CheckState = checkstate.unchecked
I did not have option strict turned on in one of my forms, and now that it is I have an error saying that you can't convert an integer value to a checkbox checkstate value. I thought these were the same thing?
I am reading through a file with a bunch of 1's and 0's in it that saves the checkstate of different checkboxes between program executions, and those values were written by reading the checkstate of the checkboxes when the program closed the last time.
'this is the line that gives me problems with option strict on
chkIncludeSampleNumber.CheckState = CInt(temp) ' where temp is a string, either 1 or 0
with option strict off this line worked just fine checking or leaving the checkbox blank, but I want it to be right.
Does that mean I have to do this or is there a better solution:
if temp = "1"
chkIncludeSampleNumber.CheckState = checkstate.checked
else
chkIncludeSampleNumber.CheckState = checkstate.unchecked