7
Reply

I was trying to create a form similar to notepad using rich text box . when I selected a part of text and try to delete it using richtextbox1.delete(); command the entire text was getting deleted . I tried using richtextbox1.selectedtext.remove(); it dint work. please help.

sravanti rachala

sravanti rachala

13y
7.6k
0
Reply

    Mr.Parvez Mulla : Thanks for your suggestion . But i used rich text box since i wanted to design my form like a notepad and rich text box would make my program easy.

    Instead of using richtextbox you use textbox and set the property of multiline = true; it's easy to use for all code

    Thank You all.

    It was very help full

    you just use.
    private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
            {
                this.richTextBox1.Cut();
            }

    M.Nadeem

    you just use

                private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
            {
                this.richTextBox1.Cut();
            }

    M.Nadeem

    just replace the selected text with empty string..

    richtextbox1.selectedtext = "";


    Can you explain how you selected the text?