Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB
how to create a button which can copy the text from textbox
and that text can be paste anywhere in window(like foldername,in text file,in wordpad etc)
 
plz send me code for this operation for vb 2008 to hardeepkinng2009@gmail.com
Posted 30-Mar-12 21:14pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

On Button Click Event Write the followin Code :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       'If You want to Copy Text from TextBox1
       Clipboard.SetData(System.Windows.Forms.DataFormats.StringFormat, TextBox1.Text)
End Sub
I Hope It will help you.Smile | :)
 
--MKB
  Permalink  
Comments
HARDEEP_SAINI at 31-Mar-12 7:21am
   
thanks alot bro....
i do't know much about vb i just trying to make a keygen and from a video tutorial i come to know how to make a keygen but the problem is that i want that when i generate a key i want to copy that one and paste at desire location
 
i think my problem will end by ur solution
now i am gng to see ur code
HARDEEP_SAINI at 31-Mar-12 7:30am
   
yes it is exactly what i want
can i know how i would rate you or any thing else like in fb we like someone comment
i am new user to this site..............
HARDEEP_SAINI at 31-Mar-12 8:12am
   
and sir can u plz tell me how to give icon to application or form which i made
Manoj K Bhoir at 2-Apr-12 0:23am
   
It's easy.Whatever Icon File You want to Set for Your Application follow these steps:
Right Click On Prject Solution-Goto Properties-In Application Tab Browse the Icon which you want to set for your application.After that Build your Application.:)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

In the Click event of Button use the following code
System.Windows.Forms.Clipboard.SetText(TextBox1.Text.Trim(), System.Windows.Forms.TextDataFormat.Text)
with the above code the Text in the TextBox will be copied to the clip board, then the text can be paste at the desired location.
  Permalink  
v2
Comments
HARDEEP_SAINI at 31-Mar-12 7:13am
   
thanks alot for rply.....
HARDEEP_SAINI at 31-Mar-12 7:37am
   
sorry sir but this is not what i want
but i will welcome u....
i want this
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'If You want to Copy Text from TextBox1
Clipboard.SetData(System.Windows.Forms.DataFormats.StringFormat, TextBox1.Text)
End Sub
HARDEEP_SAINI at 31-Mar-12 7:41am
   
but his is also same sorry.....................
i do't know much about vb

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Richard MacCutchan 269
1 Aajmot Sk 252
2 Marcin Kozub 235
3 Sergey Alexandrovich Kryukov 185
4 Praneet Nadkar 167
0 OriginalGriff 7,913
1 Sergey Alexandrovich Kryukov 7,232
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,865


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 31 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100