opennet sdf question. Clipboard works, cut() does not

  • Thread starter Thread starter PPCdude
  • Start date Start date
P

PPCdude

Hi,

I am having some trouble with the opennet sdf. I have gotten it to
copy variables to the clipboard from a textboxex object if I explicity
tell it to. i.e.:

Dim strtxt As String = txtobj.SelectedText.ToString
Dim onsf As OpenNETCF.Windows.Forms.Clipboard
If strtxt <> "" Then
onsf.SetClipboardText(strtxt)
End If

But if I simply use txtobj.cut it doesn't work. Nothing gets copied
to the clipboard and the selected text doesn't get cut.

Any ideas on what I might be doing wrong?

Thank you
 
Which version of the SDF, on what device and show us the code that "doesn't
work" (rather than the code that does). If there is a compilation/runtime
error tell us which line it is on or otherwise describe what "doesn't work"
means (expected results/actual results).

As an aside, Clipboard has static members so you don't need to declare a
variable (onsf) for it - just use the class name instead.

Cheers
Daniel
 
Which version of the SDF, on what device and show us the code that "doesn't
work" (rather than the code that does). If there is a
compilation/runtime
error tell us which line it is on or otherwise describe what "doesn't
work"
means (expected results/actual results)..<<<

Thanks Daniel, hope no offense was taken, I know it's something I am
doing.

For the most part, I did list the code. But here are the event
handlers.

Private Sub mnuCut_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles mnuCut.Click

txtobj.cut()
End Sub

txtobj.cut() where txtobj is a textboxex.

My expected results would be that the text in txtobj would be both
copied to the clipboard and removed from the textbox instance.

This is opennet sdf 1.2
 
The TextBoxEx class Cut method sends a WM_CUT to the native textbox control.
What is your target platform - PocketPC, Smartphone, Windows CE?

I don't remember making any changes to this specific method, but have you
tried the code against the SDF v1.3?

Peter
 
Peter,

I may have to look into WM_CUT info. I will also try version 1.3 and
see if that helps.

This is being used for Pocket PC.

Also, as posted above, should the txtobj.cut() work as I have it?

I've also got as my only opennet imports the following:

Imports OpenNETCF.Windows.Forms
Imports OpenNETCF.Win32

thank you!
 
I've put a very basic sample app here:-
http://www.peterfoot.net/UsingTheClipboard.aspx

It works on my Pocket PC 2003 device, the context menu doesn't behave on the
2002 emulator as the textbox loses it's selection when the context menu is
invoked. This was built with SDF v1.3, you should also check you have the
latest .NETCF service pack installed on your device (SP3). If you have
problems with that code I'd be interested in more specifics of the device
you are using (PPC 2000/2002 etc) and how you are invoking the Cut method
(e.g. a context menu like this example?)

Peter
 
Back
Top