msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VB copy a text box

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
msmuzila



Joined: 04 Oct 2007
Posts: 1

PostPosted: Tue Jun 13, 2006 3:00 pm    Post subject: VB copy a text box Reply with quote

I have a text box and a command button. I want to command button to
select the contents of the text box and copy it to the clipboard so
that i can paste it in another program. Here is the code that i have
for the command button so far. The setfocus is the command i am using
to select all.

Private Sub Command300_Click()
MCX_Name.SetFocus
End Sub

Thanks
Matt

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
Karl E. Peterson



Joined: 04 Oct 2007
Posts: 4836

PostPosted: Tue Jun 13, 2006 3:20 pm    Post subject: Re: VB copy a text box Reply with quote

msmuzila@gmail.com wrote:
> I have a text box and a command button. I want to command button to
> select the contents of the text box and copy it to the clipboard so
> that i can paste it in another program. Here is the code that i have
> for the command button so far. The setfocus is the command i am using
> to select all.
>
> Private Sub Command300_Click()
> MCX_Name.SetFocus
> End Sub

You don't need to set focus to the textbox. Just something like this:

Clipboard.Clear
Clipboard.SetText MCX_Name.Text

--
Working without a .NET?
http://classicvb.org/

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
copy files from one dir. to another.. Hi ... I am making a program in VB 6 in which I need to take all files from one specific user-desired folder .. and then want to save them into another folder with filenames .. like .... 01.ext ...02.ext ...03.ext .... it should take all f

How do I copy a existent object to a collection? I want to save several DAO.Relations objects in a Collection from a DAO.Database object before delete the relations from its source. But, if I use this command: Dim Col as new Collection Col.Add 'Db is a global variable that contains my da

Script, Excel, Word and copy and paste hi i want VB Script to "copy and paste" an image, from an excel cell (pasted and saved to there before manually) to Word. i thought something by using the win clipboard, but i have no idea of the correct syntax and haven't found something anywhere. if som

PasteSpecial Macro Text to Text I read the macro about pastespecial datatype = wdPasteText but when i try to copy text in a different format (for instance a different font) and i want to paste it into a new document then the above macro will not remove the format of the copied text. Is

Howto make a Copy of File and retrieve the resulting file na Hi! I want to make copy of a file with the target destination the same as the original file and let Windows pick the filename, e.g. Copy of File.txt of Copy(2) of File.txt. This works fine, but my problem is that I am not able to get hold of the resultin
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group