Notepad Code

Go down

Notepad Code

Post by Ashraf47 on Mon Jun 10, 2013 6:44 pm

Notepad Code For VB

Add
1.MenuStrip

Make In MenuStrip
2.File , Edit , Format

Add
3.RichTextBox


Code Text Color Is Red

File

1.New
RichTextBox1.Clear()

2.Open
Try
Dim dlg As OpenFileDialog = New OpenFileDialog
dlg.Title = "Open"
dlg.Filter = "Rich Text Files (*.rtf)|*.rtf"
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.LoadFile(dlg.FileName)
End If
Catch ex As Exception
End Try


3.Save
Try
Dim dlg As SaveFileDialog = New SaveFileDialog
dlg.Title = "Save"
dlg.Filter = "Rich Text Files (*.rtf)|*.rtf"
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.SaveFile(dlg.FileName, RichTextBoxStreamType.RichText)
End If
Catch ex As Exception
End Try

4.Exit
End


Edit

Undo
RichTextBox1.Undo()

Redo
RichTextBox1.Redo()

Cut
RichTextBox1.Cut()

Copy
RichTextBox1.Copy()

Paste
RichTextBox1.Paste()

Clear
RichTextBox1.Clear()

SelectAll
RichTextBox1.SelectAll()

Format

Font
Try
Dim dlg As FontDialog = New FontDialog
dlg.Font = RichTextBox1.Font
If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.Font = dlg.Font
End If
Catch ex As Exception
End Try


Color
Try
Dim dlg As ColorDialog = New ColorDialog
dlg.Color = RichTextBox1.ForeColor
If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.ForeColor = dlg.Color
End If
Catch ex As Exception
End Try



The Code By Ashraf47
avatar
Ashraf47
Admin

Posts : 153
Join date : 2013-05-06
Age : 20

View user profile http://ultrasoft.forumegypt.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum