2011-08-02 3 views

Répondre

5

Essayez ceci:

Dim b As String() = Split(TextBox1.Text, vbNewLine) 

    TextBox1.Text = String.Join(vbNewLine, b, 1, b.Length - 1) 

Voir String.Join pour référence.

+0

solution élégante, CodeBuzz! –

1

assez facile:

Private Sub bttnFirstLine_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bttnFirstLine.Click 
     txtBox.Text = txtBox.Text.Substring(txtBox.Text.IndexOf(vbCrLf)) 
end sub 

ou

Private Sub bttnFirstLine_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bttnFirstLine.Click 
      dim myString = txtBox.text 
      txtBox.Text = myString.Substring(myString.IndexOf(vbCrLf)) 
    end sub 
+0

Salut merci, il a travaillé Comment puis-je le faire aussi appuyer sur le bouton Supprimer? car il le supprime mais laisse la ligne là je le veux pour que la ligne efface aussi le prochain –

+0

Changez cela en 'txtBox.Text = myString.Substring (myString.IndexOf (vbCrLf)) + 2' Vous avez sauter les caractères LF et CR. –

+0

@ Hand-E-Food La conversion de la chaîne "joe" vers le type "Double" n'est pas valide. est mon code Dim myString = gathered.TextBox1.Text gathered.TextBox1.Text = myString.Substring (myString.indexOf (vbCrLf)) + 2 –

Questions connexes