S susu Well-Known Member Licensed User Longtime User Mar 17, 2015 #1 Hi, I use TextField to show multi line text. I set Editable = False but when I tap and hold the text, there's popup to copy/cut text. How to disable it?
Hi, I use TextField to show multi line text. I set Editable = False but when I tap and hold the text, there's popup to copy/cut text. How to disable it?
Erel B4X founder Staff member Licensed User Longtime User Mar 17, 2015 #2 Try this: B4X: Dim no As NativeObject = YourTextView no.SetField("selectable", false) Upvote 0
Arf Well-Known Member Licensed User Longtime User Nov 21, 2015 #3 I am trying to do this too, I get an error though. "[<UITextField 0x14ec8b30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key selectable." My code: B4X: Dim no As NativeObject = addressEntryBox no.SetField("selectable", False) 'prevent copy/paste Upvote 0
I am trying to do this too, I get an error though. "[<UITextField 0x14ec8b30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key selectable." My code: B4X: Dim no As NativeObject = addressEntryBox no.SetField("selectable", False) 'prevent copy/paste
JanPRO Well-Known Member Licensed User Longtime User Nov 21, 2015 #4 It only works for a TextView ... Upvote 0
Arf Well-Known Member Licensed User Longtime User Nov 21, 2015 #5 Oh dammit, thread title said TextField. Is there anything I can do to prevent copy/paste in a TextField, or any event I can use to detect a copy or paste? Upvote 0
Oh dammit, thread title said TextField. Is there anything I can do to prevent copy/paste in a TextField, or any event I can use to detect a copy or paste?
JanPRO Well-Known Member Licensed User Longtime User Nov 21, 2015 #6 Arf said: Is there anything I can do to prevent copy/paste in a TextField, or any event I can use to detect a copy or paste? Click to expand... But the TextField should be still editable? Upvote 0
Arf said: Is there anything I can do to prevent copy/paste in a TextField, or any event I can use to detect a copy or paste? Click to expand... But the TextField should be still editable?
Arf Well-Known Member Licensed User Longtime User Nov 21, 2015 #7 Yes, I want the user to be able to type text, but not copy the text or paste text in. I've managed to detect a paste event like this, seems to work OK: B4X: Sub addressEntryBox_TextChanged (Old As String, New As String) If New.Length > Old.Length + 2 Then 'paste must have occurred Upvote 0
Yes, I want the user to be able to type text, but not copy the text or paste text in. I've managed to detect a paste event like this, seems to work OK: B4X: Sub addressEntryBox_TextChanged (Old As String, New As String) If New.Length > Old.Length + 2 Then 'paste must have occurred