Avatar of vbsterxx
vbsterxx asked on

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.
Visual Basic Classic

Avatar of undefined
Last Comment
unknown_routine

8/22/2022 - Mon
sirbounty

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
David Lee

me!label2 = me!label1
ASKER
vbsterxx

how to copy the control, not just it's caption or value. thanx
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER CERTIFIED SOLUTION
sirbounty

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
sirbounty

You can also create more at runtime...see here: http://www.vbexplorer.com/VBExplorer/vb_feature/april2000/april2000.asp
unknown_routine


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

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


SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
unknown_routine

I have supplied a working solution to the question.

Accept with grade A or B seems proper.
Regards.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
sirbounty

I suggest a split:  sirbounty {http:#10745889} & unknown_routine {http:#10746287}
unknown_routine

Split seems good to me.

Regards.