Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27469

VS 2010 Disable Cut, Copy and Paste buttons at times. E.g. when text isn't selected.

$
0
0
Hello All,

I am making a text editor and have got the following 4 buttons included- cut, copy, paste & clear clipboard. How would i make the cut, copy and paste buttons only clickable when either text is highlighted to cut or copy and for the paste button only to appear when text has been previously highlighted and the cut and copy button has been pressed.

Private Sub cutbtn_Click(sender As System.Object, e As System.EventArgs) Handles cutbtn.Click
richtextbox.Cut()
End Sub

Private Sub copybtn_Click(sender As System.Object, e As System.EventArgs) Handles copybtn.Click
richtextbox.Copy()
End Sub

Private Sub pastebtn_Click(sender As System.Object, e As System.EventArgs) Handles pastebtn.Click
richtextbox.Paste()

Private Sub clearclipboardbtn_Click(sender As System.Object, e As System.EventArgs) Handles clearclipboardbtn.Click
My.Computer.Clipboard.Clear()
End Sub


Any ideas?:wave:

Viewing all articles
Browse latest Browse all 27469

Trending Articles