6

Hi

I want to make direct copy/paste so for example I just make one click to button direct will make the paste to clipboard for this you can write example code

Kiru
  • 3,489
  • 1
  • 25
  • 46
fatin53
  • 71
  • 1
  • 1
  • 6

3 Answers3

12

If you want to copy from a textbox (in this example textBox1), this is what you need:

Clipboard.SetText(textBox1.Text); //To copy your text to your clipboard
Clipboard.GetText(); //To get your text from your clipboard
Rodrigue Rens
  • 277
  • 3
  • 8
2

Use

Clipboard.SetText("your Text")

to Put Text to Clipboard

and

String myText = Clipboard.GetText()

to recieve Text from Your Keyboard.

sebastianmehler
  • 1,033
  • 1
  • 11
  • 23
  • ı want just make one click copy/paste direct to clipboard all files – fatin53 Apr 13 '12 at 12:16
  • 1
    @fatin53: Yeah, and `Clipboard.GetText()` and `Clipboard.SetText(string text)` will do the trick. We're not here to write your code for you. If you want a ready-to-go program, you should ask on [the programmers site](http://programmers.stackexchange.com/). – Nuffin Apr 13 '12 at 12:19
0

For Listbox:

myListbox.Items.Add(Clipboard.GetText());
sebastianmehler
  • 1,033
  • 1
  • 11
  • 23
  • ı make this with code direct copy but have one problem ı copy write too listbox (collection) this resolved foreach loop how ı take with file name to listbox – fatin53 Apr 13 '12 at 12:25