将字母定义为数字,包括作为循环字符串的一部分

时间:2014-06-07 03:07:29

标签: vb.net for-loop

    If SecretWordLength = 5 Then
        Label3.Visible = True
        Label4.Visible = True
        Label5.Visible = True
        Label6.Visible = True
        Label7.Visible = True
    End If

这是当前的代码,用于根据密码的长度在我的刽子手游戏中显示字母下方。如何将其更改为FOR循环,以便我不必单独为每个标签重复此代码?

我正在考虑以这种方式使用FOR循环:

    For i = 3 To 7
        Labeli.Visible = True
    Next

但它不起作用,因为它将i视为字母本身,而不是我想要它代表的数字。请帮忙?

0 个答案:

没有答案