MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Disable Copy/Paste In SingleLineEdit in PowerBuilder

Published on 24 August 18
639
0
0
Stop Copy/Paste Into Single Line Edit
You might have Encountered the scenarios where we are supposed to stop copy/pasting from RightMouse Button / SHIFT + Insert / Cntrl + V to the Single Line Edit. Use the below technique to accomplish the same
/* Create a function f_dissable_copy_paste or a window function of_disable_copy_paste( ) with return type (None) and write the below code in that. I am using window function in this case.*/

string ls_str

ls_str = clipboard()
ls_str = ""
clipboard(ls_str)


/* To Disable right click write below code in RButtonDown of SLE*/

MessageBox("Info","Right Click Disabled,Please enter the values manually")
of_disable_copy_paste( )
return 1

/* To Disable the Cntrl+V and Shift+Insert options, the moment the user press Cntrl/Shift make the clipboard data to blank which means nothing will be there in clipboard to copy. Simple, right? But how to achieve this ?*/

/* Write one user event ue_disable_copy_paste for SLE and select the event ID as pbm_keydown . Write the below code in that */

IF Key = KeyControl! or Key=KeyShift! THEN of_disable_copy_paste( )

That's It!!!!!!!!!!!

You may use a userobject of SLE type and reuse the code further if you are using SLE multiple times :)

Hope you enjoy this!

Note:
Make sure - if you want to use control and shift the focus should not be on SLE

Stop Copy/Paste Into Single Line Edit

You might have Encountered the scenarios where we are supposed to stop copy/pasting from RightMouse Button / SHIFT + Insert / Cntrl + V to the Single Line Edit. Use the below technique to accomplish the same

/* Create a function f_dissable_copy_paste or a window function of_disable_copy_paste( ) with return type (None) and write the below code in that. I am using window function in this case.*/
string ls_str

ls_str = clipboard()

ls_str = ""

clipboard(ls_str)

/* To Disable right click write below code in RButtonDown of SLE*/

MessageBox("Info","Right Click Disabled,Please enter the values manually")

of_disable_copy_paste( )

return 1

/* To Disable the Cntrl+V and Shift+Insert options, the moment the user press Cntrl/Shift make the clipboard data to blank which means nothing will be there in clipboard to copy. Simple, right? But how to achieve this ?*/

/* Write one user event ue_disable_copy_paste for SLE and select the event ID as pbm_keydown . Write the below code in that */

IF Key = KeyControl! or Key=KeyShift! THEN of_disable_copy_paste( )

That's It!!!!!!!!!!!

You may use a userobject of SLE type and reuse the code further if you are using SLE multiple times :)

Hope you enjoy this!

Note:

Make sure - if you want to use control and shift the focus should not be on SLE

This blog is listed under Development & Implementations Community

Related Posts:
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
 
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top