|
-
Mar 3rd, 2001, 06:03 AM
#1
Thread Starter
Fanatic Member
I'm making an ordinary program, it consists of many controls such as Webbrowser, Text Box, Rich Text Box, etc.. I have a menu that has Cut/Copy/Paste in it. I want those to work just as they would in any other program... How do I do that??
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Mar 3rd, 2001, 06:08 AM
#2
_______
<?>
Code:
'paste into a textbox
Text1 = Clipboard.Gettext
'get text from a textbox
Clipboard.Settext Text1.text
'copy a variable content to clipboard
Clipboard.Settext MyVar
'clear the clipboard
Clipboard.Clear
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Mar 3rd, 2001, 06:33 AM
#3
Thread Starter
Fanatic Member
that will only work if you are using a textbox called text1! I want it to work for all controls!
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Mar 3rd, 2001, 11:29 AM
#4
Lively Member
You could use the ActiveControl property of the form to find out the control that the caret is currently in.
eg:
Code:
Dim ctl as Control
Set ctl = Me.ActiveControl
If TypeOf ctl Is TextBox Or TypeOf ctl Is RichTextBox Then
Clipboard.SetText ctl.SelText
ElseIf TypeOf ctl Is WebBrowser Then
' I have not used this control before, so ask for others help
End If
-
Mar 3rd, 2001, 02:13 PM
#5
Thread Starter
Fanatic Member
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Mar 5th, 2001, 06:46 AM
#6
Thread Starter
Fanatic Member
It seems to me that AhBeng has the right idea....But Isn't there an easier way of doing his method...BUT, I'll have over 50 lines of code just for the "Copy Feature" because I have lots of controls on my form!!!
Visual Basic 6.0
Visual C++ 5
Delphi 5

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
|