|
-
Jul 14th, 2002, 08:40 PM
#1
Thread Starter
Hyperactive Member
Cut And Paste problem
I have a problem that involves cutting and pasting into a text box. I have a TextBox_change function that doesn't get called when i use cut and paste. My question is, how do i catch the use of the cut and paste option so that my program can do what it needs to do when the contents of the text box are changed by ANY method?
Thanx all in advance.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Jul 14th, 2002, 09:34 PM
#2
The Change event should always fire when text is pasted into a textbox.
-
Jul 14th, 2002, 09:38 PM
#3
-
Jul 14th, 2002, 09:45 PM
#4
Thread Starter
Hyperactive Member
Boy is my face red! This should be a warning to me to do a LOT more testing on my code. The problem turned out to have nothing to do with the text box, but with the code i had running to test it. I was highlighting the ENTIRE contents of the text box and pressing delete, and it wasn't updating another form i was using. That was because of the code i called on TextBox_change rather than textbox change not being called.
Thanx for all the help on this anyway.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Jul 15th, 2002, 04:54 AM
#5
Frenzied Member
You can use also toolbars Cut,Copy ans Paste buttons this way:
VB Code:
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case LCase(Button.Key)
Case "cut"
If TypeOf Me.ActiveControl Is TextBox Then
Clipboard.SetText Me.ActiveControl.SelText
Me.ActiveControl.SelText = ""
End If
Case "copy"
If TypeOf Me.ActiveControl Is TextBox Then
Clipboard.SetText Me.ActiveControl.SelText
End If
Case "paste"
If TypeOf Me.ActiveControl Is TextBox Then
Me.ActiveControl.SelText = Clipboard.GetText()
End If
End Select
End Sub
oh1mie/Vic

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|