rich text box cut

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anirban
    New Member
    • Sep 2006
    • 17

    #1

    rich text box cut

    how can I do the cut copy and paste in the rich text box
    of visual basic 6.0

    for cut I use
    Code:
    Private Sub mnucut_Click()
    Clipboard.Clear
    
    rtb.SelText Clipboard.GetText
    rtb.SelText = " "
    
    End Sub
    but it not running properly
    Last edited by Killer42; Apr 1 '07, 02:11 AM. Reason: Please use [CODE]...[/CODE] tags around your code.
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    I think your code look alright, except...
    rtb.SelText Clipboard.GetTe xt
    What is this line supposed to do? Does it even compile?

    (It looks to me as though you have your cut/paste operations jumbled up here.)

    Comment

    • anirban
      New Member
      • Sep 2006
      • 17

      #3
      Originally posted by Killer42
      I think your code look alright, except...
      rtb.SelText Clipboard.GetTe xt
      What is this line supposed to do? Does it even compile?

      (It looks to me as though you have your cut/paste operations jumbled up here.)

      please tell me what is the right code

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by anirban
        please tell me what is the right code
        As I said, I think you were pretty close.

        Try this (I haven't tested it)...
        Code:
        Private Sub mnucut_Click()
          Clipboard.Clear
          Clipboard.SetText rtb.SelText, vbCFText
          rtb.SelText = ""
        End Sub

        Comment

        Working...