- 博客(0)
- 资源 (6)
- 收藏
- 关注
vb菜单设计
Public Class Form1
Private Sub 打开0ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 打开0ToolStripMenuItem.Click
Dim fname As String
OpenFileDialog1.Filter = "文本文件(*.txt)|*.txt|RTF格式文件(*.RTF)|*.RTF"
OpenFileDialog1.FilterIndex = 1
OpenFileDialog1.Title = "打开文件"
2012-12-31
vb内容查找和替换
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RichTextBox1.LoadFile(TextBox1.Text, RichTextBoxStreamType.RichText)
RichTextBox1.Focus()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If RichTextBox1.Modified = True Then
RichTextBox1.SaveFile(TextBox1.Text, RichTextBoxStreamType.RichText)
ElseIf RichTextBox1.Modified = False Then
MessageBox.Show("已保存")
RichTextBox1.Focus()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim str1 As String
str1 = TextBox2.Text
Str = RichTextBox1.Find(str1, Str, RichTextBoxFinds.MatchCase)
If str = -1 Then
MessageBox.Show("已查找到文档的结尾!", "查找结束")
str = 0
Else
str = str + str1.Length
End If
RichTextBox1.Focus()
End Sub
Dim str As Integer
Private Sub TextBox2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged '修改查找文本判定’
str = 0
End Sub
End Class
2012-12-31
vb字体设置
Public Class Form1
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox1.Font = New Font("宋体", TextBox1.Font.Size, TextBox1.Font.Style)
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
TextBox1.Font = New Font("隶书", TextBox1.Font.Size, TextBox1.Font.Style)
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
TextBox1.Font = New Font("黑体", TextBox1.Font.Size, TextBox1.Font.Style)
End Sub
Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
TextBox1.Font = New Font(TextBox1.Font.FontFamily, 12, TextBox1.Font.Style)
End Sub
Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
TextBox1.Font = New Font(TextBox1.Font.FontFamily, 18, TextBox1.Font.Style)
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
TextBox1.Font = New Font(TextBox1.Font.FontFamily, TextBox1.Font.Size, TextBox1.Font.Style)
End Sub
Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
TextBox1.Font = New Font(TextBox1.Font.FontFamily, TextBox1.Font.Size, TextBox1.Font.Style)
End Sub
Private Sub CheckBox1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If (CheckBox1.Checked) Then
TextBox1.Font = New Font(TextBox1.Font, TextBox1.Font.Style Or FontStyle.Bold)
Else
TextBox1.Font = New Font(TextBox1.Font, TextBox1.Font.Style Xor FontStyle.Bold)
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Obje
2012-12-31
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人