Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I make a button select and copy all the text in a textbox?

Posted on 2004-05-02
1
Medium Priority
?
175 Views
Last Modified: 2010-05-02
I need a button to select and copy all the text in "finalcode.Text", how can I make it do this?
0
Comment
Question by:neopetzrulez
1 Comment
 
LVL 19

Accepted Solution

by:
Shauli earned 80 total points
ID: 10971637
locate a command button on your fotm amd paste this code to its click event:

Private Sub Command1_Click()
Clipboard.Clear
finalcode.SelStart = 0
finalcode.SelLength = Len(finalcode.Text)
finalcode.SetFocus
Clipboard.SetText finalcode.Text, vbCFText
End Sub

S
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question