Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Clearing parts of a RichTextBox

$
0
0
Hi there,

I've been busy writing a small and simple HTML-Editor for myself.
I used a TabControl with 2 tabs (Editor and Webpage) and in the Editor-tab I used a RichTextBox. In the webpage-tab I used a WebBrowser.

Everything is working just fine. But then I wanted to add a small menu with File - New - Exit and now I have a question about the "New".

You see ... in my Editor-tab I have already inserted some standard Text:

<html>
<head>
<title></title>
</head>

<body>

</body>
</html>

First I'll give you the code of the program:

Public Class HTMLeditor

    Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
        WebBrowser1.DocumentText = RichTextBox1.Text
    End Sub

    Private Sub NieuwToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NieuwToolStripMenuItem.Click
        'Here has to come a clear-function for everything except what was there in the first place.

    End Sub

    Private Sub AfsluitenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AfsluitenToolStripMenuItem.Click
        End
    End Sub
End Class


Now ... with the "New"-menubutton I want to clear everything except what was there in the first place.
How do I do this? can somebody help me please?

greetings,
RH-Design.


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>