0

I'm trying to get the text of the textbox control to the clipboard and I ran out of ideas on how to do it. Any ideas on getting the clipboard to work?

My code as of now:

partial void copy1_Execute()
    {
        // Write your code here.
        string Copylink1, dLink1;
        Downloadables copydl = this.Downloadables.SelectedItem;
        dLink1 = Convert.ToString(copydl.Link1);
        Copylink1 = dLink1;
        Microsoft.LightSwitch.Threading.Dispatchers.Main.BeginInvoke(() =>
            Clipboard.SetText(Copylink1);
            });
        this.ShowMessageBox("Link copied to clipboard. Ctrl + V to paste", "Downloadable", MessageBoxOption.Ok);
    }
user3744076
  • 127
  • 6
  • 15

1 Answers1

0

Nevermind. I fixed it.

Sample code:

partial void copy1_Execute()
    {
        // Write your code here.
        string Copylink1, dLink1;
        Downloadable copydl = this.Downloadables.SelectedItem;
        dLink1 = Convert.ToString(copydl.Link1);
        Copylink1 = dLink1;
        Microsoft.LightSwitch.Threading.Dispatchers.Main.BeginInvoke(() =>
            {
            Clipboard.SetText(Copylink1);
            });
        this.ShowMessageBox("Link copied to clipboard. Ctrl + V to paste", "Downloadable", MessageBoxOption.Ok);
    }
user3744076
  • 127
  • 6
  • 15