nvms
asked on
TextBox.Copy() to Clipboard in C# Compact Framework ?
Hi
I am finding more and more aspects of the .NET Compact Framework lacking the full framework. From what I can see I cannot copy text selections to the clipboard ? Does anyone know if this is just a "wait for Service Pack 2" issue or if I am not Using xxxx; the right resources.
Thanks
Stu
I am finding more and more aspects of the .NET Compact Framework lacking the full framework. From what I can see I cannot copy text selections to the clipboard ? Does anyone know if this is just a "wait for Service Pack 2" issue or if I am not Using xxxx; the right resources.
Thanks
Stu
ASKER
Hi thanks for the comments, this of course works fine in a Windows project but in a Mobile Device project (using the Compact .NET Framework) the following error is generated on deployment:
C:\Documents and Settings\My Documents\Files\CODE\C#.NE T Examples\Clipboard Handling\Copy\Form1.cs(93) : The type or namespace name 'Clipboard' could not be found (are you missing a using directive or an assembly reference?)
Code is OK from your example with the following references:
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.IO;
My problem remains, the CF does not support the clipboard
C:\Documents and Settings\My Documents\Files\CODE\C#.NE
Code is OK from your example with the following references:
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.IO;
My problem remains, the CF does not support the clipboard
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Already tried as have all the other standard clipboard commands, retults in:
C:\Documents and Settings\Files\CODE\C#.NET Examples\Clipboard Handling\Copy\Form1.cs(98) : 'System.Windows.Forms.Text Box' does not contain a definition for 'Copy'
If you start a new .NET project and choose a Smart Device Application using the Emulator you will see the problem
C:\Documents and Settings\Files\CODE\C#.NET
If you start a new .NET project and choose a Smart Device Application using the Emulator you will see the problem
ASKER
Please note THERE IS NO SOLUTION ON THIS PAGE !!! I have awarded the points as thanks for contributing but as you know having found this, the .NET Compact Framework is rather 'cut-down'. The functions suggested will not work. Open to further discussion on this topic.
look at this page:
http://www.opennetcf.org/forms.asp this is an open source libary which provides the needed feature
http://www.opennetcf.org/forms.asp this is an open source libary which provides the needed feature
private void button1_Click(object sender, System.EventArgs e) {
// Takes the selected text from a text box and puts it on the clipboard.
if(textBox1.SelectedText != "")
Clipboard.SetDataObject(te
else
textBox2.Text = "No text selected in textBox1";
}