vb 菜单编辑器 其控件如何写代码
菜单上有编辑,编辑下面有剪切、复制、粘贴三项,如何实现其各自的功能,同时要求当进行复制/粘贴操作后,只有“粘贴”菜单项可用。谢谢!...
菜单上有编辑,编辑下面有剪切、复制、粘贴三项,如何实现其各自的功能,同时要求当进行复制/粘贴操作后,只有“粘贴”菜单项可用。谢谢!
展开
2个回答
展开全部
"同时要求当进行复制/粘贴操作后,只有“粘贴”菜单项可用。谢谢! "
这样操作的话 以后不能再"剪切""复制"了 好像有点怪!!
Option Explicit
Private Sub Form_Load()
剪切菜单.Enabled = True
复制菜单.Enabled = True
粘贴菜单.Enabled = False
End Sub
Private Sub 复制菜单_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText, ClipBoardConstants.vbCFText
粘贴菜单.Enabled = True
剪切菜单.Enabled = False
复制菜单.Enabled = False
End Sub
Private Sub 剪切菜单_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText, ClipBoardConstants.vbCFText
Text1.SelText = ""
粘贴菜单.Enabled = True
End Sub
Private Sub 粘贴菜单_Click()
Dim a As String
a = Clipboard.GetText(ClipBoardConstants.vbCFText)
Text1.SelText = a
剪切菜单.Enabled = False
复制菜单.Enabled = False
粘贴菜单.Enabled = True
End Sub
这样操作的话 以后不能再"剪切""复制"了 好像有点怪!!
Option Explicit
Private Sub Form_Load()
剪切菜单.Enabled = True
复制菜单.Enabled = True
粘贴菜单.Enabled = False
End Sub
Private Sub 复制菜单_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText, ClipBoardConstants.vbCFText
粘贴菜单.Enabled = True
剪切菜单.Enabled = False
复制菜单.Enabled = False
End Sub
Private Sub 剪切菜单_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText, ClipBoardConstants.vbCFText
Text1.SelText = ""
粘贴菜单.Enabled = True
End Sub
Private Sub 粘贴菜单_Click()
Dim a As String
a = Clipboard.GetText(ClipBoardConstants.vbCFText)
Text1.SelText = a
剪切菜单.Enabled = False
复制菜单.Enabled = False
粘贴菜单.Enabled = True
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询