资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

vb.net做记事本的简单介绍

VB.net怎么才能实现记事本中的查找上一个的功能(在Richtextbox中)?

查找一次后记入查找内容的位置,百查找下一个功能度 这时候的开始位置就是刚才查找内容的位置加上查找内容的长度,版突出显示其实就是选权定文本,富文本框有SelectionStart,SelectionLength 两个属性

创新互联公司专业为企业提供汤原网站建设、汤原做网站、汤原网站设计、汤原网站制作等企业网站建设、网页设计与制作、汤原企业网站模板建站服务,十多年汤原做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。

VB.NET写一个记事本程序,如何用程序让使用者编辑好的内容独立的存在硬盘上?

你是说记事本的配置吧,

如果设置不是太大,可以保存在注册表中,

另外可以用xml文件或者ini文件来保存配置,

不知道有没理解错你的意思

怎么用VB.NET做一个记事本

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

OpenFileDialog1.ShowDialog()

RichTextBox1.LoadFile(Me.OpenFileDialog1.FileName, RichTextBoxStreamType.PlainText)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim fname As String

Me.SaveFileDialog1.ShowDialog()

fname = Me.SaveFileDialog1.FileName

If (fname "") Then

If (Me.OpenFileDialog1.FilterIndex = 1) Then

Me.RichTextBox1.SaveFile(fname, RichTextBoxStreamType.PlainText)

Else

Me.RichTextBox1.SaveFile(fname, RichTextBoxStreamType.RichText)

End If

End If

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Me.SaveFileDialog2.ShowDialog()

If (Me.OpenFileDialog1.FileName "") Then

If (Me.OpenFileDialog1.FilterIndex = 1) Then

Me.RichTextBox1.SaveFile(Me.SaveFileDialog2.FileName, RichTextBoxStreamType.PlainText)

Else

Me.RichTextBox1.SaveFile(Me.SaveFileDialog2.FileName, RichTextBoxStreamType.RichText)

End If

End If

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.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 Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.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 打开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如何用我编写的一个记事本程序通过鼠标右键菜单来打开一个文件

一、用wshshell组件的RegWrite方法写注册表,在HKEY_CLASSES_ROOT\*\Shell 位置加入的你程序,

例如:

[HKEY_CLASSES_ROOT\*\shell\我的程序\command]

@="D:\\我的程序.exe %1"

后面的%1会将文件名传送给你的程序的Command$,多文件名需要使用DDE方式进行互斥传入。

二、

将下面内容输入记事本后保存为reg文件,运行即可:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\OpenInNotepad]

@="用记事本打开"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\OpenInNotepad\command]

@="notepad.exe %1"

"用记事本打开" 为右键菜单中显示的名称


分享题目:vb.net做记事本的简单介绍
浏览地址:http://cdkjz.cn/article/dojdoop.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220