我用vb设计记事本,不会的有字体,字形,大小,代码设计完了,可是文字剪切粘贴都不好使

我估计是CommonDialog1和RichTextBox安装的不对,代码是PrivateSubmnucolor_Click()cmdopen.ShowColorRich... 我估计是 CommonDialog1 和RichTextBox安装的不对,代码是
Private Sub mnucolor_Click()
cmdopen.ShowColor
RichTextBox1.SelColor = cmdopen.Color
End Sub
Private Sub mnuOpen_Click()
CommonDialog1.Filter = "文本文档(*.txt)|*.txt|RTF文档(*.rtf)|*.rtf|所有文件(*.*)|*.*"
CommonDialog1.ShowOpen
RichTextBox1.Text = "" '清空文本框
FileName = CommonDialog1.FileName
RichTextBox1.LoadFile FileName
Me.Caption = "超级记事本:" & FileName
End Sub
Private Sub mnuSave_Click()
CommonDialog1.Filter = "文本文档(*.txt)|*.txt|RTF文档(*.rtf)|*.rtf|所有文件(*.*)|*.*"
CommonDialog1.ShowSave
FileType = CommonDialog1.FileTitle
FiType = LCase(Right(FileType, 3))
FileName = CommonDialog1.FileName
Select Case FiType
Case "txt"
RichTextBox1.SaveFile FileName, rtfText
Case "rtf"
RichTextBox1.SaveFile FileName, rtfRTF
Case "*.*"
RichTextBox1.SaveFile FileName
End Select
Me.Caption = "超级记事本:" & FileName
End Sub
Private Sub mnuCopy_Click()
Clipboard.Clear
Clipboard.SetText RichTextBox1.SelText
End Sub
Private Sub mnuCut_Click()
Clipboard.Clear
Clipboard.SetText RichTextBox1.SelText
RichTextBox1.SelText = ""
End Sub
Private Sub mnuPaste_Click()
RichTextBox1.SelText = Clipboard.GetText
End Sub
Private Sub mnuFont_Click()
cmdopen.Flags = cdlCFBoth + cdlCFEffects
cmdopen.ShowFont
With RichTextBox1
.SelFontName = cmdopen.FontName
.SelFontSize = cmdopen.FontSize
.SelBold = cmdopen.FontBold
.SelItalic = cmdopen.FontItalic
.SelStrikeThru = cmdopen.FontStrikethru
.SelUnderline = cmdopen.FontUnderline
End With
End Sub

Private Sub RichTextBox3_Change()

End Sub
各位高手帮我看看,那里错了,我觉得代码对,运行成功了一次,后来改那两个控件就不好使了
展开
 我来答
wuxexdzvj
2011-03-11 · TA获得超过107个赞
知道答主
回答量:233
采纳率:0%
帮助的人:0
展开全部
单,字体设置,字型设置,颜色等,给你做一下参考。
留下邮箱给你发过去。
源代码:
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
博思aippt
2024-07-20 广告
作为深圳市博思云创科技有限公司的工作人员,对于Word文档生成PPT的操作,我们有以下建议:1. 使用另存为功能:在Word中编辑完文档后,点击文件->另存为,选择PowerPoint演示文稿(*.pptx)格式,即可将文档内容转换为PPT... 点击进入详情页
本回答由博思aippt提供
·千帆舞·770f
2011-03-10 · TA获得超过126个赞
知道小有建树答主
回答量:133
采纳率:0%
帮助的人:83.3万
展开全部
把源文件发过来 我邮箱qfw.dx@qq.com
追问
过去了吗
追答
Clipboard.SetText RichTextBox1.SelText
?????不用‘=’???
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式