Clipboard

Discussion in 'Questions (Windows Mobile)' started by brucem, Aug 16, 2007.

  1. brucem

    brucem New Member Licensed User

    Can anyone see what is wrong.
    I have done a short program that should paste texbox1.text into textbox2.text (if i am understanding things right).
    When button1 is clicked textbox2 goes blank (no text). The text in textbox1 is "textbox1", shouldn't that be copied?

    Sub Globals
    'Declare the global variables here.
    End Sub

    Sub App_Start
    Form1.Show
    hw.new1 'hw is a Hardware object.
    End Sub


    Sub Button1_Click
    hw.SetClipboardData(textbox1.Text)
    textbox2.Text=hw.GetClipboardData
    End Sub
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Are you running this code on a device?
     
  3. brucem

    brucem New Member Licensed User

    No this was on the desk-top
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    The Hardware library is only supported on the device.
    It uses OS features that are unique to the device OS.
     
  5. Rioven

    Rioven Active Member Licensed User

    Hi,
    I've tried using hardware.SetClipBoardData, hardware.GetClipBoardData and formlib context menu for "cut/copy/paste/Select All" function on a textbox1.
    but SetClipBoardData and GetClipBoardData return the whole text of textbox1 to textbox2 while I've only selected portion of text.

    I've followed the help samples.
    Can you help me on this?:sign0085:

    PHP:

    Sub App_Start

    hrdwr01
    .new1 ' a Hardware object.
    hrdwr01.SetClipboardData(Textbox1.Text)

    formlib1.New1("form1"",B4PObject(1)) 

          Context1.New1
          Context1.AddItem("Cut")
          Context1.AddItem("Copy")
          Context1.AddItem("Paste")
          Context1.AddItem("Delete")
          Context1.AddItem("-") '
    Adds a separator
          Context1
    .AddItem("Select All")

          
    formlib1.AddContextMenu("Textbox1",Context1.Value)
    End Sub

    Sub context1_click
    Select context1
    .SelectedText
    Case "Cut"
    textbox2.text=hrdwr01.GetClipboardData
    Case "Copy"
    Case "Paste"
    Case "-"
    Case "Select All"
    End Select
    End Sub
    What other things I've missed?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

  7. Rioven

    Rioven Active Member Licensed User

    Thank you so much!
     
Loading...