[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with Strings in the Clipboard


Am 19.01.26 um 15:30 schrieb Gianluigi:
Hi Claus,

I probably didn't understand
And if you do this:
[code]Public Sub Form_Open()

  TextArea1.Text = "https://www.gambas-buch.de";

End

Public Sub Button1_Click()

  If Clipboard.Type = Clipboard.Text Then
    Clipboard.Copy(TextArea1.Text, "text/html")
    ' Clipboard.Copy(TextArea1.Text, "text/plain")
    TextArea2.Text = Clipboard.Paste()
  Endif

End[/code]

With Best Regards
Gianluigi

Then the result is ok.

Here a summary of my observations and conclusions:

1    If the Source is a Gambas TextArea:

       a) the context-menu-item "copy" of the TextArea delivers a HTML page to the clipboard. Why is that?

       b) the function Clipboard.Copy(TextArea1.Text) delivers text to the clipboard.

2.  If the source is external (i.e. Writer) the function Clipboard.Paste() may return Null.

The only way to always obtain usable text from the clipboard was the use of Clipboard.Paste("text/plain") - for whatever reason.

Best regards

Claus

P.S: My observation about URLs and my interpretation of "Support for URIs" was wrong. It seems that I was "lost in the woods".



Follow-Ups:
Re: Problem with Strings in the ClipboardBruce Steers <bsteers4@xxxxxxxxx>
References:
Problem with Strings in the ClipboardClaus Dietrich <claus.dietrich@xxxxxxxxxx>
Re: Problem with Strings in the ClipboardLee <t.lee.davidson@xxxxxxxxx>
Re: Problem with Strings in the ClipboardClaus Dietrich <claus.dietrich@xxxxxxxxxx>
Re: Problem with Strings in the ClipboardGianluigi <gradobag@xxxxxxxxxxx>