题目是:从窗体里输入A和E 然后依次输出ABCDEBCDAECDEABDEABCEABCD其中A和E是从键盘输入,怎么做?(A和E是我举的例子,可以随意。)窗体的创建我知道,就是不知道怎么写输出的代码!希望各位帮忙!

热心网友

你的第二行输错了A和E反了。用两个循环就可以。假设在页面上放置text1输入你的字符,text2显示结果MultiLine属性为true,button1执行操作。则代码为:Private Sub Command1_Click()Dim a(20) As StringDim i, j As IntegerDim strT As StringFor i = 0 To Len(Text1。Text) - 1 a(i) = Mid(Text1。Text, i + 1, 1)Next istrT = ""For i = 0 To Len(Text1。Text) - 1 For j = i To Len(Text1。Text) - 1 strT = strT & a(j) Next j For j = 0 To i - 1 strT = strT & a(j) Next j strT = strT & vbCrLfNext i Text2。Text = strTEnd Sub。

热心网友

Private Sub Command1_Click()Dim c1 As String * 1, c2 As String * 1Dim s As String, n1 As Integer, n2 As Integer, i As Integers = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"c1 = InputBox("First letter: ")c2 = InputBox("Second letter: ")n1 = InStr(1, s, c1, 1)n2 = InStr(1, s, c2, 1)If n1 < n2 Thens = Mid(s, n1, n2 - n1 + 1)Elses = Mid(s, n1) & Left(s, n2)End IfFor i = 1 To Len(s)Print Mid(s, i) & Left(s, i - 1)Next iEnd Sub。

热心网友

代码如下,仅适用0-127范围的ASCII码:Option ExplicitDim b1 As StringDim b2 As StringDim bl(128) As StringDim bls As ByteDim blj As ByteDim i As ByteDim bb As StringDim n As BytePrivate Sub Command1_Click()b1 = Text1b2 = Text2bls = Asc(b1)blj = Asc(b2)If bls blj ThenFor i = blj To blsbl(i) = Chr(i)bb = bb + bl(i)Text3 = bbNext iEnd Ifn = Len(bb)Print bbFor i = 2 To nPrint Mid(bb, i, n + 1 - i) + Mid(bb, 1, i - 1)Next iEnd Sub。