1.在text1.text中输入类似如下的多行字符
A
A1
C
D2
...2.在text2.text中实时显示出转换过的,用下横线分隔开的1行字符,如:
1_2_4_6

解决方案 »

  1.   

    Private Sub Text1_Change()
    If Len(Trim(Text1.Text)) >= 1 Then
        If Asc(Right(Text1.Text, 1)) = 10 Then
            Text2.Text = Text2.Text + "_"
        Else
            Text2.Text = Text2.Text + CStr(Asc(Right(Text1.Text, 1)) - 64)
        End If
    End If
    End Sub上面的例子对于单个字符就可以满足你的实时转化的要求了。不知对你有没有帮助或启发?
      

  2.   

    呵呵是的,规则如下,最多2个字符:A=1
    Bb=2
    B=3
    C=4
    Db=5
    D=6
    Eb=7
    E=8
    F=9
    Gb=10
    G=11
    Ab=12
      

  3.   

    Private Sub Text1_Change()    Dim strTmp As String
        
        strTmp = Replace(Text1, vbCrLf, "-")
        strTmp = Replace(strTmp, "Bb", "2")
        strTmp = Replace(strTmp, "Db", "5")
        strTmp = Replace(strTmp, "Eb", "7")
        strTmp = Replace(strTmp, "Gb", "10")
        strTmp = Replace(strTmp, "Ab", "12")
        strTmp = Replace(strTmp, "A", "1")
        strTmp = Replace(strTmp, "B", "3")
        strTmp = Replace(strTmp, "C", "4")
        strTmp = Replace(strTmp, "D", "6")
        strTmp = Replace(strTmp, "E", "8")
        strTmp = Replace(strTmp, "F", "9")
        strTmp = Replace(strTmp, "G", "11")
        
        Text2 = strTmp
    End Sub