Copy read only entry in Xamarin Forms

Hi,

I need a read-only entry so I set IsEnabled to false, but the most bad side effect is that when I long click the system menu (copy, paste, and select all) does not appear.

Any advices?

Tagged:

Answers

  • JohnHardmanJohnHardman GBUniversity mod

    Have you tried using the IsReadOnly property of Entry instead of IsEnabled?
    See https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/entry

    I am still using an older version of XF in which IsReadOnly is not available, so don't know whether Select, Select All, and Copy are supported when using IsReadOnly.

    (as IsReadOnly wasn't available when I needed it, I implemented my own version which handles Select, Select All and Copy as expected).

    @BilalSammour said:
    the system menu (copy, paste, and select all) does not appear.

    Note that a readonly Entry should not show Paste as an option.

Sign In or Register to comment.