Cut, paste, copy questions... 
Author Message
 Cut, paste, copy questions...

Okay.. i can get cut, paste, and copy to work, but only for specific
text boxes and such.. using:
Private Sub mnucopy_Click()

If Text1.SelText = "" Then
 Exit Sub
Else
Clipboard.Clear
Clipboard.SetText Text1.SelText
End If
End Sub

Private Sub mnucut_Click()

If Text1.SelText = "" Then
Exit Sub
Else
Clipboard.Clear
Clipboard.SetText Text1.SelText
Text1.SelText = ""
End If
End Sub

Private Sub mnupaste_Click()
Text1.SelText = Clipboard.GetText
End Sub

But i need the three options to work everywhere in my program, in every
text box.. a generic version if you will..  any ideas??  Thanks

Moebius



Fri, 20 Sep 2002 03:00:00 GMT  
 Cut, paste, copy questions...
This is easily done. Make a Sub for each function for example for the Copy
procedure:

Sub CopyToClipBrd(txtText As TextBox)
    If txtText.SelText = "" Then
        Exit Sub
    Else
        Clipboard.Clear
        Clipboard.SetText txtText.SelText
    End If
End If

Then you can call it like this:

CopyToClipBrd Text1

And it'll do exactly what you want it to.
--
Sincerely,
Thomas Daugaard

Visit my domain at http://www.tdaugaard.dk/
ICQ me on 48525216


Quote:
> Okay.. i can get cut, paste, and copy to work, but only for specific
> text boxes and such.. using:
> Private Sub mnucopy_Click()

> If Text1.SelText = "" Then
>  Exit Sub
> Else
> Clipboard.Clear
> Clipboard.SetText Text1.SelText
> End If
> End Sub

> Private Sub mnucut_Click()

> If Text1.SelText = "" Then
> Exit Sub
> Else
> Clipboard.Clear
> Clipboard.SetText Text1.SelText
> Text1.SelText = ""
> End If
> End Sub

> Private Sub mnupaste_Click()
> Text1.SelText = Clipboard.GetText
> End Sub

> But i need the three options to work everywhere in my program, in every
> text box.. a generic version if you will..  any ideas??  Thanks

> Moebius



Sat, 21 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Multiple textboxes Cut,Copy,Paste question

2. Cut, Copy, Paste

3. How can I copy records like cut-n-paste

4. disabling cut/copy/paste

5. disabling copy/paste/cut on shape shortcut menu

6. Cut,Copy,Paste

7. cut, copy and paste

8. cut copy and paste

9. Cut, Copy and Paste in the menu bar

10. Help Cut/Copy & Paste

11. cut, copy, and paste

12. cut/copy/paste

 

 
Powered by phpBB® Forum Software