关于vb.net开发记事本的信息( 五 )


Me.ColorDialog1.Color = Me.RichTextBox1.SelectionColor
If (Me.ColorDialog1.ShowDialog() = Me.DialogResult.OK) Then
Me.RichTextBox1.SelectionColor = Me.ColorDialog1.Color
End If
End Sub
Private Sub 打开ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 打开ToolStripMenuItem.Click
Try
Dim str As String
Dim typel As System.Windows.Forms.RichTextBoxStreamType
OpenFileDialog1.ShowDialog()
str = OpenFileDialog1.FileName
RichTextBox1.LoadFile(str, RichTextBoxStreamType.PlainText)
Catch ex As Exception
End Try
End Sub
Private Sub 保存ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 保存ToolStripMenuItem.Click
Me.SaveFileDialog1.ShowDialog()
If (Me.SaveFileDialog1.FileName"") Then
If (Me.OpenFileDialog1.FilterIndex = 1) Then
Me.RichTextBox1.SaveFile(Me.SaveFileDialog1.FileName, RichTextBoxStreamType.PlainText)
Else
Me.RichTextBox1.SaveFile(Me.SaveFileDialog1.FileName, RichTextBoxStreamType.RichText)
End If
End If
End Sub
Private Sub 另存为ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 另存为ToolStripMenuItem.Click
Me.SaveFileDialog1.ShowDialog()
If (Me.OpenFileDialog1.FileName"") Then
If (Me.OpenFileDialog1.FilterIndex = 1) Then
Me.RichTextBox1.SaveFile(Me.SaveFileDialog1.FileName, RichTextBoxStreamType.PlainText)
Else
Me.RichTextBox1.SaveFile(Me.SaveFileDialog1.FileName, RichTextBoxStreamType.RichText)
End If
End If
End Sub
Private Sub 退出ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 退出ToolStripMenuItem.Click
End
End Sub
Private Sub 字体ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 字体ToolStripMenuItem.Click
Me.FontDialog1.Font = Me.RichTextBox1.SelectionFont
If (Me.FontDialog1.ShowDialog() = Me.DialogResult.OK) Then
Me.RichTextBox1.SelectionFont = Me.FontDialog1.Font
End If
End Sub
Private Sub 颜色ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 颜色ToolStripMenuItem.Click
Me.ColorDialog1.Color = Me.RichTextBox1.SelectionColor
If (Me.ColorDialog1.ShowDialog() = Me.DialogResult.OK) Then
Me.RichTextBox1.SelectionColor = Me.ColorDialog1.Color
End If
End Sub
Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
End Sub
End Class
【关于vb.net开发记事本的信息】vb.net开发记事本的介绍就聊到这里吧,感谢你花时间阅读本站内容 , 更多关于、vb.net开发记事本的信息别忘了在本站进行查找喔 。

推荐阅读