locked
RTB BOX DATA TO ACCES DB RRS feed

  • Pregunta

  • Good morning Im using a rich text box to add data to from a text field, essentially this is column data

    Im adding and deleting OK but the delete is just replacing with a space my question is if there are say four items how do I move the text up to fill space 

          private void btnmedsremove_Click(object sender, EventArgs e)
            {
                rtbmeds.SelectedText = "";

    • Cambiado CoolDadTx miércoles, 26 de agosto de 2020 15:00 Winforms related
    miércoles, 26 de agosto de 2020 12:08

Respuestas

  • The following may or may not help, it removes empty lines

    rtb.Text = Regex.Replace(rtb.Text, @"^\s*$(\n|\r|\r\n)", "", RegexOptions.Multiline);
    https://stackoverflow.com/questions/5763877/how-to-remove-blank-lines-from-richbox


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marcado como respuesta dubiousp jueves, 27 de agosto de 2020 11:55
    miércoles, 26 de agosto de 2020 13:57