If Text1(0).Text = "R" And Text1(1).Text = "Z" And Text1(2).Text = "1" And Text1(3).Text = "1" Then
RichTextBox1.Text = Text1(0).Text & Text1(1).Text & Text1(2).Text & Text1(3).Text & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).Text & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & "瑞" & "成" & "车" & "量" & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).TextElseIf Text1(0).Text = "R" And Text1(1).Text = "Z" And Text1(2).Text = "1" And Text1(3).Text = "2" Then
RichTextBox1.Text = Text1(0).Text & Text1(1).Text & Text1(2).Text & Text1(3).Text & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).Text & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & "瑞" & "成" & "车" & "小" & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).TextElseIf Text1(0).Text = "R" And Text1(1).Text = "Z" And Text1(2).Text = "1" And Text1(3).Text = "3" Then
RichTextBox1.Text = Text1(0).Text & Text1(1).Text & Text1(2).Text & Text1(3).Text & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).Text & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & "瑞" & "成" & "车" & "首" & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).Text
ElseIf Text1(0).Text = "R" And Text1(1).Text = "Z" And Text1(2).Text = "2" And Text1(3).Text = "1" Then
RichTextBox1.Text = Text1(0).Text & Text1(1).Text & Text1(2).Text & Text1(3).Text & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).Text & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & "瑞" & "成" & "车盒" & "量" & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).TextElseIf Text1(0).Text = "R" And Text1(1).Text = "Z" And Text1(2).Text = "2" And Text1(3).Text = "2" Then
RichTextBox1.Text = Text1(0).Text & Text1(1).Text & Text1(2).Text & Text1(3).Text & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).Text & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & "瑞" & "成" & "盒" & "小" & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).TextElseIf Text1(0).Text = "R" And Text1(1).Text = "Z" And Text1(2).Text = "2" And Text1(3).Text = "3" Then
RichTextBox1.Text = Text1(0).Text & Text1(1).Text & Text1(2).Text & Text1(3).Text & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).Text & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & "瑞" & "成" & "盒" & "首"" & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).Text"

解决方案 »

  1.   


    RichTextBox1.Text = ""
    For i=0 to 17
        RichTextBox1.Text = RichTextBox1.Text & Text1(i).Text 
    Next
    For i=1 to 12
        RichTextBox1.Text = RichTextBox1.Text & " "
    Next
    RichTextBox1.Text = RichTextBox1.Text & "瑞" & "成" 
    If Text1(0).Text = "R" And Text1(1).Text = "Z" Then
        If Text1(2).Text = "1" Then
            RichTextBox1.Text = RichTextBox1.Text & "车"
            If Text1(3).Text = "1" Then
                RichTextBox1.Text = RichTextBox1.Text & "量"
            ElseIf Text1(3).Text = "2" Then
                RichTextBox1.Text = RichTextBox1.Text & "小"
            ElseIf Text1(3).Text = "3" Then
                RichTextBox1.Text = RichTextBox1.Text & 
            End If
        ElseIf Text1(2).Text = "2" Then
            RichTextBox1.Text = RichTextBox1.Text & "盒"
            If Text1(3).Text = "1" Then
                RichTextBox1.Text = RichTextBox1.Text & "量"
            ElseIf Text1(3).Text = "2" Then
                RichTextBox1.Text = RichTextBox1.Text & "小"
            ElseIf Text1(3).Text = "3" Then
                RichTextBox1.Text = RichTextBox1.Text & "首"
            End If
        End If
    End If
    For i=4 to 17
        RichTextBox1.Text = RichTextBox1.Text & Text1(i).Text 
    Next
      

  2.   

    猜你第四个"车盒"应该是打错了,应该是"盒"RichTextBox1.Text = ""
    For i=0 to 17
        RichTextBox1.Text = RichTextBox1.Text & Text1(i).Text 
    Next
    For i=1 to 12
        RichTextBox1.Text = RichTextBox1.Text & " "
    Next
    RichTextBox1.Text = RichTextBox1.Text & "瑞" & "成" 
    If Text1(0).Text = "R" And Text1(1).Text = "Z" Then
        If Text1(2).Text = "1" Then
            RichTextBox1.Text = RichTextBox1.Text & "车"
            If Text1(3).Text = "1" Then
                RichTextBox1.Text = RichTextBox1.Text & "量"
            ElseIf Text1(3).Text = "2" Then
                RichTextBox1.Text = RichTextBox1.Text & "小"
            ElseIf Text1(3).Text = "3" Then
                RichTextBox1.Text = RichTextBox1.Text & "首"
            End If
        ElseIf Text1(2).Text = "2" Then
            RichTextBox1.Text = RichTextBox1.Text & "盒"
            If Text1(3).Text = "1" Then
                RichTextBox1.Text = RichTextBox1.Text & "量"
            ElseIf Text1(3).Text = "2" Then
                RichTextBox1.Text = RichTextBox1.Text & "小"
            ElseIf Text1(3).Text = "3" Then
                RichTextBox1.Text = RichTextBox1.Text & "首"
            End If
        End If
    End If
    For i=4 to 17
        RichTextBox1.Text = RichTextBox1.Text & Text1(i).Text 
    Next
      

  3.   

    '简化即要考虑书写简单,更要考虑效率,本人的思路即解决方案如下,请参阅:
    '将3个Text控件的text值合并,使用select case语句
    '如果不考虑楼主可有出现的笔误,赋值语句中有两处是相同的,可以将它们分别赋值为两个变量。
    '另外,多个"" 可以使用space(intNumber)函数代替;Text控件的默认属性为Text,可以缺省。
    Dim intCx As Integer
    Dim StrGet$, strResult1$, strResult2$
    'Text合并值
    StrGet = text1(0) & text1(1) & text1(2) & text1(3)
    '第一处:Text1(0).Text & Text1(1).Text & Text1(2).Text & Text1(3).Text & Text1(4).Text & Text1(5).Text & Text1(6).Text & Text1(7).Text & Text1(8).Text & Text1(9).Text & Text1(10).Text & Text1(11).Text & Text1(12).Text & Text1(13).Text & Text1(14).Text & Text1(15).Text & Text1(16).Text & Text1(17).Text & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & " " & "瑞" & "成"
    '第二处:text1(4).Text & text1(5).Text & text1(6).Text & text1(7).Text & text1(8).Text & text1(9).Text & text1(10).Text & text1(11).Text & text1(12).Text & text1(13).Text & text1(14).Text & text1(15).Text & text1(16).Text & text1(17).Text
    '二处又多有重复,进一步简便
    '可用循环语句代替:strResult2 = text1(4) & text1(5) & text1(6) & text1(7) & text1(8) & text1(9) & text1(10) & text1(11) & text1(12) & text1(13) & text1(14) & text1(15) & text1(16) & text1(17)For intCx = 4 To 17
        strResult2 = strResult2 & text1(intCx)
    Next intCxstrResult1 = text1(0) & text1(1) & text1(2) & text1(3) & strResult2 & Space(12) & "瑞" & "成"Select Case StrGet
    Case "RZ11"
        RichTextBox1.Text = strResult1 & "车" & "量" & strResult2
    Case "RZ12"
        RichTextBox1.Text = strResult1 & "车" & "小" & strResult2
    Case "RZ13"
        RichTextBox1.Text = strResult1 & "车" & "首" & strResult2
    Case "RZ21"
        RichTextBox1.Text = strResult1 & "车盒" & "量" & strResult2
    Case "RZ22"
        RichTextBox1.Text = strResult1 & "盒" & "小" & strResult2
    Case "RZ23"
        RichTextBox1.Text = strResult1 & "盒" & "首" & strResult2
    End Select