超級簡單
1、新增三個text控制元件,text1 text2和text3,並且把MultiLine屬性設為True,注意:三個都要設為true
2.新增一個command控制元件,command1
3、複製程式碼進去執行
Private Sub Command1_Click()
Dim temp1() As String
Dim temp2() As String
temp1() = Split(Text1.Text, vbCrLf)
temp2() = Split(Text2.Text, vbCrLf)
For i = 0 To UBound(temp1)
Text3.Text = Text3.Text & temp1(i) & ":" & temp2(i) & vbCrLf
Next i
End Sub
Private Sub Form_Load()
Text1.Text = "北京" & vbCrLf & "上海" & vbCrLf & "天津"
Text2.Text = "1號" & vbCrLf & "2號" & vbCrLf & "3號"
Command1.Caption = "合併"
超級簡單
1、新增三個text控制元件,text1 text2和text3,並且把MultiLine屬性設為True,注意:三個都要設為true
2.新增一個command控制元件,command1
3、複製程式碼進去執行
Private Sub Command1_Click()
Dim temp1() As String
Dim temp2() As String
temp1() = Split(Text1.Text, vbCrLf)
temp2() = Split(Text2.Text, vbCrLf)
For i = 0 To UBound(temp1)
Text3.Text = Text3.Text & temp1(i) & ":" & temp2(i) & vbCrLf
Next i
End Sub
Private Sub Form_Load()
Text1.Text = "北京" & vbCrLf & "上海" & vbCrLf & "天津"
Text2.Text = "1號" & vbCrLf & "2號" & vbCrLf & "3號"
Command1.Caption = "合併"
End Sub