Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

how: copy / past, labels / textboxes, using code in vb???

how: copy / past,   labels / textboxes, using code in vb???

copy me!label1  to  me!label2  or some such method, thanx much.
0
vbsterxx
Asked:
vbsterxx
2 Solutions
 
sirbountyCommented:
If
Text1.text="Text"
Label1.Caption="Text"
Then...


Private Sub Command1_CLick()
Text2.text=Text1.text
End Sub


Private Sub Command2_Click()
Label2.caption=label1.caption
End Sub
0
 
David LeeCommented:
me!label2 = me!label1
0
 
vbsterxxAuthor Commented:
how to copy the control, not just it's caption or value. thanx
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
sirbountyCommented:
Select the control - Edit/Copy then Edit/Paste.
You will then be creating a control array...

Reference each 'copy' of this control array by using the Index property (starting at 0 for the first and so on)...
0
 
sirbountyCommented:
You can also create more at runtime...see here: http://www.vbexplorer.com/VBExplorer/vb_feature/april2000/april2000.asp
0
 
unknown_routineCommented:

You can not copy/paste a control at run time.

This is because unilike VB IDE clipboard object won't hold the control information .


0
 
unknown_routineCommented:
However you can simlute it:

Step 1:

set form keypreview property to true


Step 2:

User select a control, so control is highlighted, and presses Control+C you use form keypress event
to trap this keys.

Step3:

User  presses Control+V(paste) , again you trap these keys and do the paste on position X and Y of form

Which are defined in Form1.CurrentX and form1.currentY
0
 
unknown_routineCommented:
I have supplied a working solution to the question.

Accept with grade A or B seems proper.
Regards.
0
 
sirbountyCommented:
I suggest a split:  sirbounty {http:#10745889} & unknown_routine {http:#10746287}
0
 
unknown_routineCommented:
Split seems good to me.

Regards.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now