[IWE] Hey Chris - C# question

Jay Mehaffey iwe@warhead.org.uk
Wed, 17 Jan 2007 09:00:55 -0800 (PST)


--0-1182958517-1169053255=:46130
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

If you just want to move text to and from the clipboard it is easy. Just do this to save to the clipboard: 
Clipboard.SetDataObject(textBox1.Text, true);

And then to pull the text back out it is:

textBox1.Text = Clipboard.GetDataObject().GetData(DataFormats.Text).ToString();

That is assuming you are building a Windows application. It is possible to access the clipboard from ASP.NET but harder and not of much use.

Jay





Barry Roomberg <broomberg@comcast.net> wrote: How to I save something into the Windows cut&paste buffer from within my 
application?

I've got a current cell in a grid.

I assume I need to deal with the  following"
"Public objSel As TextSelection = DTE.ActiveDocument.Selection"

But the docs only show VB usage.

Blech.

_______________________________________________
IWE mailing list
IWE@warhead.org.uk
http://lists.warhead.org.uk/mailman/listinfo/iwe


 
---------------------------------
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
--0-1182958517-1169053255=:46130
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

If you just want to move text to and from the clipboard it is easy. Just do this to save to the clipboard: <span id="intelliTXT"><pre lang="cs">Clipboard.SetDataObject(textBox1.Text, <span class="cs-keyword">true</span>);<br><br>And then to pull the text back out it is:<br><span id="intelliTXT"><pre lang="cs">textBox1.Text = Clipboard.GetDataObject().GetData(DataFormats.Text).ToString();<br><br>That is assuming you are building a Windows application. It is possible to access the clipboard from ASP.NET but harder and not of much use.<br><br>Jay<br><br><span style="font-family: arial;"></span></pre></span></pre></span><br><br><b><i>Barry Roomberg &lt;broomberg@comcast.net&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> How to I save something into the Windows cut&amp;paste buffer from within my <br>application?<br><br>I've got a current cell in a grid.<br><br>I assume I need to deal with the 
 following"<br>"Public objSel As TextSelection = DTE.ActiveDocument.Selection"<br><br>But the docs only show VB usage.<br><br>Blech.<br><br>_______________________________________________<br>IWE mailing list<br>IWE@warhead.org.uk<br>http://lists.warhead.org.uk/mailman/listinfo/iwe<br></blockquote><br><p>&#32;

<hr size=1>Expecting? Get great news right away with <a href="http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html">email Auto-Check.</a><br>Try the <a href="http://us.rd.yahoo.com/evt=49982/*http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html">Yahoo! Mail Beta.</a>
--0-1182958517-1169053255=:46130--