VB.net问题,跪求代码
1.在窗体上添加FontDialog和ColorDialog控件
2.分别在菜单“字体”和“颜色”添加以下两段代码代码
Private Sub 字体ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 字体ToolStripMenuItem.Click
FontDialog1.ShowDialog()
RichTextBox1.Font = FontDialog1.Font
End Sub
Private Sub 颜色ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 颜色ToolStripMenuItem.Click
Dim dialogResult As DialogResult = ColorDialog1.ShowDialog()
RichTextBox1.ForeColor = Me.ColorDialog1.Color
End Sub
3.调试如图
Private Sub 字体ToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles 字体ToolStripMenuItem.Click
FontDialog1.ShowDialog()
TextBox1.Font = FontDialog1.Font
End Sub
Private Sub 颜色ToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles 颜色ToolStripMenuItem.Click
ColorDialog1.ShowDialog()
TextBox1.ForeColor = ColorDialog1.Color
End Sub
不好了,我忘记上面那个标题栏目怎么弄了
晕 采纳的那个抄我的?
使用common dialog控件
分别输入commondialog控件的action的值
难道不要代码?