mobile application doesnt have clipboard this object, so what is the control/ object can use to replace the clipboard???
Printable View
mobile application doesnt have clipboard this object, so what is the control/ object can use to replace the clipboard???
It's API time: http://msdn.microsoft.com/library/de...dfunctions.asp
need to imports name space? what name space ? can u tell me how to use?
They are API functions so you don't add a reference and you don't import a namespace. Look up the Declare statement in the help documentation for information on declaring and calling API functions.
hehehe.....never use API before, so dont know how to use, do u mind to teach me? i need the clipboard for cut , copy and paste in mobile based application
Why don't you want to use the help system? That's where I learned how to call API functions. Obviously you learn things with experience, but I read the help topic for the Declare statement just like I'm suggesting you do. It even has a link at the bottom to a topic entitled "Walkthrough: Calling Windows APIs". I think that should be all you need to get you started. You may think you do but you don't need somebody to hold your hand. Just get in and do it and if you make mistakes you'll learn more for having made them yourself. If you have issues with specific things then we're always here, but I'm here to help, not to do for you.
i dont hv MSDN in my vb.net..........
Well you have internet.Quote:
Originally Posted by kenny_oh
www.msdn.com
As grilkip suggests, everything in the VS help system is reproduced in the on-line MSDN library. You need to be a bit more specific with your search terms, because the on-line library contains a lot more information than just that, but a search for "declare statement" still returns the topic for the VB.NET Declare statement on the first page as the ninth result.
i have declare a cut function...but dont know why cannot work...is it my declarition wrong?
VB Code:
//declare function Private Declare Function setClipboardData Lib "Clipbd" Alias "setClipboardData" (ByVal CF_TEXT) As Long cut function: Private Sub mnuItmCut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuItmCut.Click If txtMessage.SelectedText <> "" Then setClipboardData("") setClipboardData(txtMessage.SelectedText) txtMessage.SelectedText = "" End If End Sub
SetClipboardData will return an Integer, and it takes two arguments. CF_TEXT is a constant that you need to define. I usually use a Google search to find the values of API constants. Check my CodeBank submission here for an example of how to define and use API constants.
the clipboard library correct?
It looks like you've picked a curly one. I've been doing a bit of research on your behalf and it seems that using the clipborad using APIs is relatively involved. I found a VB.NET example here, but keep in mind that this is for the full .NET Framework. I think you'll find that the clipboard functions are in the Clibd library, as you already alluded to, rather than the user32 library. Also, I don't think the GlobalAlloc, etc. functions exist on PPC. It looks like there are LocalAlloc, etc. functions that do the equivalent, but I've not tested any of them myself. Never done any CF work I'm afraid. Have you posted on the Mobile Development forum? If someone's already done this stuff that's where you'll find them.
You might also want to check out this site. It is an open source class library aimed at the CF and includes an inherited TextBox class that supports Cut, Copy and Paste methods. You could either use it directly or check out their source code to see how it's done, as presumably they use the same APIs that you're trying to. I'm guessing that their source will be in C#, but the principles will be the same. I guess the main difference could be that they may be using pointers in C# that you obviously cannot do in VB.NET. It's probably worth checking out regardless.