Quantcast
Channel: 神魂顛倒論壇-Flash--Visual Basic .Net 討論最新50篇論壇主題-全文
Viewing all articles
Browse latest Browse all 74

請高手幫我看看我的程式碼

$
0
0

 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim j As String
        Dim i As Integer
        Dim k As Integer
        Dim x, a, b As Integer
        a = 0
        b = 0
       x = x + 1
        j = TextBox1.Text
        If Len(j) <> 4 Then
            MsgBox("輸入錯誤,請重新輸入,不可輸入重複數值")
        End If
        For i = 0 To 9
            For k = 0 To 9
                If i = k Then
                    If (i) = (k) Then
                        a = a + 1
                    End If
                End If
                If i <> k Then
                    If (i) = (k) Then
                        b = b + 1
                    End If
                End If
            Next k
        Next i

        TextBox2 = a & "A" & b & "B" & 
    If a = 4 Then
        MsgBox("恭喜你答對了(by elong)", MsgBoxStyle.OkOnly)
            TextBox2 = "j"
           
           
    End If
End Sub


那兩行我圈起來的部份有高手可以教我怎麼修改嗎?


Viewing all articles
Browse latest Browse all 74

Trending Articles