-1

我有,text1.text在 第一个文本中我有:text2.textCommand1_Click

WUJ QAZ SFX BG3 YBN HM OTDP WL DG5PY AGEW

没有空间,

我想在点击 text2.text 时将其替换为:

无极 - 0

QAZ - 1

音效 - 2

BG3 - 6

YBN-7

HM - 8

OTDP - B

WL-D

DG5PY-E

AGEW - F

结果 text2.text 点击:012678BDEF

请使用 VISUAL BASIC 6.0

4

1 回答 1

2

这是一种方法...

Private Sub Command1_Click()
    Dim str As String
    str = Text1.Text
    str = Replace(str, "WUJ", "0")
    str = Replace(str, "QAZ", "1")
    str = Replace(str, "SFX", "2")
    str = Replace(str, "BG3", "6")
    str = Replace(str, "YBN", "7")
    str = Replace(str, "HM", "8")
    str = Replace(str, "OTDP", "B")
    str = Replace(str, "WL", "D")
    str = Replace(str, "DG5PY", "E")
    str = Replace(str, "AGEW", "F")
    Text2.Text = str
End Sub
于 2013-10-20T17:25:17.443 回答