|
-
Sep 30th, 2000, 08:21 AM
#1
I am using a calculator program and have a Paste button so that I can paste the readout or answer into a textbox on another form. In other words, I use a form (Form1) with a textbox (Text1) and I want to be able to call up the calculator form, run a calculation and then paste the result into the Form1.Text1 textbox. I have several textboxes on Form1, so I need to make sure that I paste the result into the right textbox.
I want to paste in in the textbox that has the focus. I can't figure out how to tell the Calculator Paste command button how to identify the textbox that has the focus on Form1.
Any help? Thanks.
-
Sep 30th, 2000, 08:24 AM
#2
_______
<?>
Somewhat confused on this one. If you are sending text to a textbox you must know where you are sending it. If you call form2(Calc) and do your cal why can't your just say.
form2.textWhatever.text = form1.text1.text
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 30th, 2000, 08:35 AM
#3
Maybe I am missing something so easy:
When I call up the Calculator form and calculate the numbers (e.g., 7 + 8 =15) and I click the Paste command button on the Calculator form, how does the Calculator form know which textbox on Form1 to put "15" in?
Form1 has a number of textboxes in a control array ranging from Text1(0) to Text1(15).
How does the Calculator Paste button know to put the answer "15" in Form1.Text1(6), for example.
Thanks.
-
Sep 30th, 2000, 08:45 AM
#4
_______
<?>
I was missing something...thought you were using your own calculator program not Calc...
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 30th, 2000, 09:03 AM
#5
_______
<?>
Can you use this as a walk around?
Code:
Option Explicit
Private Sub Command1_Click()
'here I shell calc and do my calculation and copy
Shell "c:\windows\calc.exe"
'Close calc
End Sub
Private Sub Command2_Click()
'here I tell text1 to get the clipboard (copied calculation)
Text1.Text = Clipboard.GetText(vbCFText) ' Get Clipboard text.
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 30th, 2000, 09:47 AM
#6
I thought about that, but there I am coding each individual textbox on Form1 for that.
I have written the program where a user can double click (DblClick Event) on any textbox (there are about 15, ranging from Text1(0) to Text1(14)). The calculator is then called up. I am using the Calculator project/form that came with VB6, except I added a command button captioned "Paste."
I want my application to remember which textbox (e.g., text1(6)) was double clicked, so that when I click Paste, the readout of the Calculator is pasted into the textbox that I double clicked.
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
|