Copy - Paste - Cut commands using VS.NET

  • Thread starter Thread starter ASUStudent
  • Start date Start date
A

ASUStudent

Hello,
I am new to programming and I am taking a class on
programming this semester. I am writing a program but I
cannot seem to find out how to copy/paste/cut code to add
so that the text from any of my textboxes can be
cut/copied/pasted to the clipboard. Any help would be
extremely useful. Thank you for all your time.

Asu Student Spring 2004
 
Hi

A piece of sampe vb.net code (the only difference with C# is the ";" at the
end of each row, the if statemement and the Dim in the sample)

Copy
\\\
Me.textbox1.SelectAll()
Clipboard.SetDataObject(me.textbox1.SelectedText)
///
Paste
\\\
Dim iData As IDataObject = Clipboard.GetDataObject()
If iData.GetDataPresent(DataFormats.Text) Then
Me.textbox2.Text = CType(iData.GetData(DataFormats.Text), String)
Else
Me.textbox2.Text = ""
End If
///

And a lot of what you ask starts with a description here

http://msdn.microsoft.com/library/en-us/vbcon/html/vbconDragDropClipboardSupport.asp

I hope this helps a little bit?

Cor
 
Thank you for your help. I should have specified my
statment alittle better. Is it possible to set the .cut
statements up to work off of an active textbox rather than
specifiy the exact one?

Justin
 
Back
Top