HTML Editor + Preview
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
4 posts
Page 1 of 1
in form1 you'll need:
1-richtextbox dock:fill
1-menustrip
1-savefiledialog filter: .html|*html
1-openfiledialog filter: .html|*html
in form2 you'll need:
1-webbrowser dock:fill
the result image:
form1: in menustrip1 you'll need to rename menu & tool
in menu there are:
-Preview
-Clear all
-Exit
in tool there are:
Open
Save
Undo
Redo
Cut
Copy
Paste
code:
the full code:


This file is hosted off-site.
1-richtextbox dock:fill
1-menustrip
1-savefiledialog filter: .html|*html
1-openfiledialog filter: .html|*html
in form2 you'll need:
1-webbrowser dock:fill
the result image:
form1: in menustrip1 you'll need to rename menu & tool
in menu there are:
-Preview
-Clear all
-Exit
in tool there are:
Open
Save
Undo
Redo
Cut
Copy
Paste
code:
the full code:
Code: Select all
Download the exe:Public Class Form1
Private Sub PreviewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PreviewToolStripMenuItem.Click
Form2.Show()
End Sub
Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim SaveFile As New SaveFileDialog
SaveFile.FileName = ""
SaveFile.Filter = "Text Files (*.html)|*.html"
SaveFile.Title = "Save"
SaveFile.ShowDialog()
Try
Dim Write As New System.IO.StreamWriter(SaveFile.FileName)
Write.Write(RichTextBox1.Text)
Write.Close()
Catch ex As Exception
End Try
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub ClearAllToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearAllToolStripMenuItem.Click
RichTextBox1.Text = ""
End Sub
Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
Form2.WebBrowser1.DocumentText = RichTextBox1.Text
End Sub
Private Sub OpenToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem1.Click
Dim OpenFile As New OpenFileDialog
OpenFile.FileName = ""
OpenFile.Filter = "Text Files (*.html)|*.html"
OpenFile.Title = "HTML"
OpenFile.ShowDialog()
Try
Dim Read As New System.IO.StreamReader(OpenFile.FileName)
RichTextBox1.Text = Read.ReadToEnd
Read.Close()
Catch ex As Exception
End Try
End Sub
Private Sub SaveToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem1.Click
Dim SaveFile As New SaveFileDialog
SaveFile.FileName = ""
SaveFile.Filter = "Text Files (*.html)|*.html"
SaveFile.Title = "Save"
SaveFile.ShowDialog()
Try
Dim Write As New System.IO.StreamWriter(SaveFile.FileName)
Write.Write(RichTextBox1.Text)
Write.Close()
Catch ex As Exception
End Try
End Sub
Private Sub UndoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UndoToolStripMenuItem.Click
RichTextBox1.Undo()
End Sub
Private Sub RedoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RedoToolStripMenuItem.Click
RichTextBox1.Redo()
End Sub
Private Sub CutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CutToolStripMenuItem.Click
RichTextBox1.Cut()
End Sub
Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click
RichTextBox1.Copy()
End Sub
Private Sub PasteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasteToolStripMenuItem.Click
RichTextBox1.Paste()
End Sub
End Class


This file is hosted off-site.
You do not have the required permissions to view the files attached to this post.
I really like the FormBorder that you made. Very Cool looking...
But I think you should do alot more to this project.
I seems to be more of a NotePad.exe then anything thing else.
But I think you should do alot more to this project.
I seems to be more of a NotePad.exe then anything thing else.
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023