Remove garbage from textBox with multiline in VB 2005

0

I have a TextBox with active multiline, to this textbox I have assigned the KeyUp event with the "Enter" key, with this the textbox content is passed to a global variable, and this in turn opens from another window; but when you open it in the other window and assign it to another textbox, it comes with garbage (What I put in the textbox and two small boxes)

They would know how to cast the content of the first textbox so that it does not send those squares.

How it is being sent from the main form is as follows:

Private Sub txtDescripcion_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtDescripcion.KeyUp
        If e.KeyCode = 13 Then
            If Trim(Replace(txtDescripcion.Text, "'", "")) <> "" Then
                txtDescripcion.Text = Replace(txtDescripcion.Text, "'", "")
                vglParBusq = txtDescripcion.Text
                frmBuscaArticulo.ShowDialog()
            End If
        End If
    End Sub

And the other way you are receiving is like this:

Private Sub frmBuscaArticulo_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated

   txtBusqueda.Text = vglParBusq 

End Sub

The variable vglParBusq is a global variable

    
asked by Javier Castillo 11.05.2018 в 19:23
source

1 answer

0

In the end, as I mentioned; because of the enter, the textbox sends two frames, corresponding to the line break. I corrected it, taking the total length of the string and as always are two garbage characters (frames), I do a mid from position 1 to the length of the string minus those two spaces that occupied those characters.

    
answered by 12.05.2018 в 08:41