VB 2008 Tutorial - How to make Advanced Notepad
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
Insert a MenuStrip, RichTextBox, OpenFileDialog and SaveFileDialog hehaho; hehaho;
Now in MenuStrip add a Menu "File"
Under "File" Menu add items New, Open, Save, Print Document and Exit
Now in MenuStrip add a another Menu "Edit"
Under "Edit" Menu add Copy, Paste, Cut add one Seperator, Then add Select All, Clear All, Font Settings, Select Color, Again add one Seperator, Then add Undo and Redo
Now double click each items in MenuStrip and add these following codes into it
Code for "New" item in MenuStrip
*******************Thanks for reading my tutorial, I think this Tutorial will be most helpful to you!*******************
If you want any custom tutorial for you or you need any help in VS.NET, VB.NET, Software Coding, Designing and much more any help in Computer stuffs just ask me
Mostly i will help everyone in coding and design stuffs in on Computer
- Best regards hehaho;
- Tvs Praveen wahooo;
- Thanks CodeNStuff! for this amazing Website cooll;
Now in MenuStrip add a Menu "File"
Under "File" Menu add items New, Open, Save, Print Document and Exit
Now in MenuStrip add a another Menu "Edit"
Under "Edit" Menu add Copy, Paste, Cut add one Seperator, Then add Select All, Clear All, Font Settings, Select Color, Again add one Seperator, Then add Undo and Redo
Now double click each items in MenuStrip and add these following codes into it
Code for "New" item in MenuStrip
Code: Select all
Code for "Open" item in MenuStripRichTextBox1.Text = ""
MsgBox("New Text Document!")
Code: Select all
Code for "Save" item in MenuStripDim alltext As String = "", lineoftext As String = ""
OpenFileDialog1.Filter = "All Files | *.*"
OpenFileDialog1.ShowDialog()
If OpenFileDialog1.FileName <> "" Then
End If
Try
FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
Do Until EOF(1)
lineoftext = LineInput(1)
alltext = alltext & lineoftext & vbCrLf
Loop
RichTextBox1.Text = alltext
Catch
Finally
FileClose()
End Try
Code: Select all
Code for "Print Document" item in MenuStripSaveFileDialog1.Title = "Save A Text Document"
SaveFileDialog1.Filter = "Text Document | *.text | all files | *.*"
SaveFileDialog1.ShowDialog()
If SaveFileDialog1.FileName <> "" Then
FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
PrintLine(1, RichTextBox1.Text)
FileClose(1)
End If
Code: Select all
Code for "Exit" item in MenuStripDim AB As New PrintDialog
Try
AB.ShowDialog()
RichTextBox1.Text = AB.PrintToFile
Catch ex As Exception
End Try
Code: Select all
Code for "Copy" item in MenuStripMe.Close()
Code: Select all
Code for "Paste" item in MenuStripRichTextBox1.Copy()
Code: Select all
Code for "Cut" item in MenuStripRichTextBox1.Paste()
Code: Select all
Code for "Select All" item in MenuStripRichTextBox1.Cut()
Code: Select all
Code for "Clear All" item in MenuStripRichTextBox1.SelectAll()
Code: Select all
Code for "Font Settings" item in MenuStripRichTextBox1.Text = ""
MsgBox("Text Cleared!")
Code: Select all
Code for "Select Color" item in MenuStripDim FS As New FontDialog
Try
FS.ShowDialog()
RichTextBox1.Font = FS.Font
Catch ex As Exception
End Try
Code: Select all
Code for "Undo" item in MenuStripDim FC As New ColorDialog
Try
FC.ShowDialog()
RichTextBox1.ForeColor = FC.Color
Catch ex As Exception
End Try
Code: Select all
Code for "Redo" item in MenuStripRichTextBox1.Undo()
Code: Select all
RichTextBox1.Redo()
*******************Thanks for reading my tutorial, I think this Tutorial will be most helpful to you!*******************
If you want any custom tutorial for you or you need any help in VS.NET, VB.NET, Software Coding, Designing and much more any help in Computer stuffs just ask me
Mostly i will help everyone in coding and design stuffs in on Computer
- Best regards hehaho;
- Tvs Praveen wahooo;
- Thanks CodeNStuff! for this amazing Website cooll;
When i save the page and open it again the color is gone
when you change color save value to my.settings and use it in new page
<3 VB & Python
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023