Member Avatar for Micheal87

Like title, more particulary, I have two textbox when user put links when finished the result will be on the second one with some default string in the 0 index of the counter and after the exiting of the loop. My question is how I can make that even the last line will be readed in the for loop? Because I was thinking that the problem will be in the temparray=textbox1.Lines

 tempArray = TextBox1.Lines
        For counter = 0 To tempArray.Length - 1
            If counter = 0 Then
                tempArray(0) = cbname2
            ElseIf counter = 1 Then
                tempArray(1) = "~!" & "img(" & tempArray(counter) & ")"
            ElseIf counter >= 2 Then
                tempArray(counter) = "img(" & tempArray(counter) & ")"
            End If
            TextBox2.Lines = tempArray
        Next
        TextBox2.Text &= vbCrLf & "!~" & " ~~~"
    End Sub
Member Avatar for Micheal87

Solved by added the first index content in the 0 index one with a combined +=

 If counter = 0 Then
                tempArray(0) = cbname2 & vbCrLf & "~!" & "img(" & tempArray(counter) & ")"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.