急!!! 求一个java编写的记事本代码 能够完成打开、保存、另存为、设置字体。
2个回答
展开全部
我以前做过一个,不过功能有所不同,有菜单和弹出菜单,字体设置,字型设置,颜色等,给你做一下参考。
留下邮箱给你发过去。
源代码:
Private Sub Blue_Click()
Text1.ForeColor = vbBlue
End Sub
Private Sub Form_Load()
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Bld.Checked = False
Itl.Checked = False
Undrln.Checked = False
End Sub
Private Sub Green_Click()
Text1.ForeColor = vbGreen
End Sub
Private Sub bld_click()
Text1.FontBold = Not Text1.FontBold
Bld.Checked = Not Bld.Checked
End Sub
Private Sub Itl_click()
Text1.FontItalic = Not Text1.FontBold
Itl.Checked = Not Itl.Checked
End Sub
Private Sub Undrln_click()
Text1.FontUnderline = Not Text1.FontUnderline
Undrln.Checked = Not Undrln.Checked
End Sub
Private Sub Red_Click()
Text1.ForeColor = vbRed
End Sub
Private Sub Text1_Change()
If Text1 = "" Then
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Else
Red.Enabled = True
Blue.Enabled = True
Green.Enabled = True
End If
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then '如果是鼠标右键按下时
Text1.Enabled = False '使文本框无效
Form1.PopupMenu Fon '弹出右键菜单
Text1.Enabled = True '再次使文本框有效
End If
End Sub
留下邮箱给你发过去。
源代码:
Private Sub Blue_Click()
Text1.ForeColor = vbBlue
End Sub
Private Sub Form_Load()
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Bld.Checked = False
Itl.Checked = False
Undrln.Checked = False
End Sub
Private Sub Green_Click()
Text1.ForeColor = vbGreen
End Sub
Private Sub bld_click()
Text1.FontBold = Not Text1.FontBold
Bld.Checked = Not Bld.Checked
End Sub
Private Sub Itl_click()
Text1.FontItalic = Not Text1.FontBold
Itl.Checked = Not Itl.Checked
End Sub
Private Sub Undrln_click()
Text1.FontUnderline = Not Text1.FontUnderline
Undrln.Checked = Not Undrln.Checked
End Sub
Private Sub Red_Click()
Text1.ForeColor = vbRed
End Sub
Private Sub Text1_Change()
If Text1 = "" Then
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Else
Red.Enabled = True
Blue.Enabled = True
Green.Enabled = True
End If
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then '如果是鼠标右键按下时
Text1.Enabled = False '使文本框无效
Form1.PopupMenu Fon '弹出右键菜单
Text1.Enabled = True '再次使文本框有效
End If
End Sub
追问
529804464@qq.com 十分感谢!!!
展开全部
有菜单和弹出菜单,字体设置,字型设置,颜色等,给你做一下参考。
。
源代码:
Private Sub Blue_Click()
Text1.ForeColor = vbBlue
End Sub
Private Sub Form_Load()
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Bld.Checked = False
Itl.Checked = False
Undrln.Checked = False
End Sub
Private Sub Green_Click()
Text1.ForeColor = vbGreen
End Sub
Private Sub bld_click()
Text1.FontBold = Not Text1.FontBold
Bld.Checked = Not Bld.Checked
End Sub
Private Sub Itl_click()
Text1.FontItalic = Not Text1.FontBold
Itl.Checked = Not Itl.Checked
End Sub
Private Sub Undrln_click()
Text1.FontUnderline = Not Text1.FontUnderline
Undrln.Checked = Not Undrln.Checked
End Sub
Private Sub Red_Click()
Text1.ForeColor = vbRed
End Sub
Private Sub Text1_Change()
If Text1 = "" Then
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Else
Red.Enabled = True
Blue.Enabled = True
Green.Enabled = True
End If
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then '如果是鼠标右键按下时
Text1.Enabled = False '使文本框无效
Form1.PopupMenu Fon '弹出右键菜单
Text1.Enabled = True '再次使文本框有效
End If
End Sub
。
源代码:
Private Sub Blue_Click()
Text1.ForeColor = vbBlue
End Sub
Private Sub Form_Load()
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Bld.Checked = False
Itl.Checked = False
Undrln.Checked = False
End Sub
Private Sub Green_Click()
Text1.ForeColor = vbGreen
End Sub
Private Sub bld_click()
Text1.FontBold = Not Text1.FontBold
Bld.Checked = Not Bld.Checked
End Sub
Private Sub Itl_click()
Text1.FontItalic = Not Text1.FontBold
Itl.Checked = Not Itl.Checked
End Sub
Private Sub Undrln_click()
Text1.FontUnderline = Not Text1.FontUnderline
Undrln.Checked = Not Undrln.Checked
End Sub
Private Sub Red_Click()
Text1.ForeColor = vbRed
End Sub
Private Sub Text1_Change()
If Text1 = "" Then
Red.Enabled = False
Blue.Enabled = False
Green.Enabled = False
Else
Red.Enabled = True
Blue.Enabled = True
Green.Enabled = True
End If
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then '如果是鼠标右键按下时
Text1.Enabled = False '使文本框无效
Form1.PopupMenu Fon '弹出右键菜单
Text1.Enabled = True '再次使文本框有效
End If
End Sub
追问
额 看不懂啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询