Greetings community.
I am Converting an application from Option Strict off to ON and came across two problems i cannot seem to figure out. Actualy i solved one but i think its a less than optimal fix so im looking for advice on the Ctype question a bit further down.

I am receiving an error in an If statment.

Code:
    If cboClass.SelectedValue = 1 Then
                  getBigBrother()
              End If
Debug Error: Option strict On disallows operands of type object for operator "=". Use the IS operator to test for object identity.

I rewrote the code attemting to use the IS accordingly.

Code:
  Dim compval As Boolean = False
            Dim num As Integer = 1
           
           compval = cboClass.SelectedValue Is num

           If compval = True Then
                    getBigBrother()
           End If
Debug error: IS requires operands that have refrence types, but this operand has value type Integer.

SO theres my primary problem, Any advice would be apreciated..

Now my second question

I had code in my app writen like this:
Code:
Dim userIdValG as String
userIdValG = cboUserName.SelectedValue
It works fine with Strict OFF, now with Strict ON i had to modify as follows.

Code:
Dim userIdValG as String
userIdValG = Cstr(cboUserName.SelectedValue)
Is that the most efficient way to cast that object to a String.???