Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 option strict on errors

$
0
0
hi

i've a few errors after turn option strict on, hope some1 can help me fix....

Error:
Code:

Option Strict On disallows implicit conversions from 'String' to 'Double'.
Codes:
Code:

        Dim currentTime As System.DateTime = System.DateTime.Now
        Dim DateOnly = currentTime.Day + "_" + GetMonth(currentTime.Month) + "_" + currentTime.Year

Error:
Code:

Option Strict On disallows narrowing from type 'System.Windows.Forms.Control' to type 'PostInstall.NSTheme' in copying the value of 'ByRef' parameter 'ThemeCtrl' back to the matching argument.
Codes:
Code:

dont need to give codes[
Error:
Code:

Option Strict On requires that all method parameters have an 'As' clause  and Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for object identity.
Codes:
Code:

    Sub FormFade(ByVal FType)
        Select Case FType
            Case ("in")
                Dim FadeCount As Integer
                For FadeCount = 10 To 75 Step 10
                    Me.Opacity = FadeCount / 100
                    Me.Refresh()
                    Threading.Thread.Sleep(50)
                Next
            Case ("out")
                Dim FadeCount As Integer
                For FadeCount = 75 To 10 Step -10
                    Me.Opacity = FadeCount / 100
                    Me.Refresh()
                    Threading.Thread.Sleep(50)
                Next
        End Select
        Me.Opacity = 95.9
    End Sub

thx....

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>