Data Access Worldwide Knowledge Base

Article ID 2208
Article Title HOWTO: Create a FORM that allows select and copy but not delete, edit, paste
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2208
KBase Category VDF11
Date Created 01/22/2006
Last Edit Date 01/22/2006


Article Text
QUESTION:
Some Windows programs have forms that look disabled but allow text to be selected and copied. You cannot edit the text or delete the text. How can we do this with Visual DataFlex?

SOLUTION:
The solution lies in:
- Setting the color to the system color for disabled controls (clBtnFace)
- Disabling many of the key presses by augmenting the key procedure
- Disabling the methods paste and cut

The enclosed class (package, BMP and DFC file) helps you to add a form to your views in which you can have this kind of control. The 3rd enclosure (DisabledFormDemo.vw) shows the usage of the cDisabledForm class.

HOW TO USE:
- Place the DFC and BMP file in the IdeSrc directory (workspace or global)
- Place the package file in the AppSrc folder (workspace or global)
- Open the Configure ClassLists dialog in the Studio
- Click the Add button in the right tabpage
- Enter cDisabledForm, cDisabledForm.Bmp and Base in the first 3 forms
- Click save

Now open the demo view, compile and see how it works.



Contributed By:
Vincent Oorsprong
Company: Data Access Worldwide
email: vincent.oorsprong@dataaccess.eu
Web Site: http://www.dataaccess.eu

Web Links Related to this Article
File cDisabledForm.Bmp
URL=http://www.dataaccess.com/KBasePublic/Files/2208.cDisabledForm.Bmp

File cDisabledForm.Dfc
URL=http://www.dataaccess.com/KBasePublic/Files/2208.cDisabledForm.Dfc

File cDisabledForm.Dfo
URL=http://www.dataaccess.com/KBasePublic/Files/2208.cDisabledForm.Dfo

File cDisabledForm.Pkg
URL=http://www.dataaccess.com/KBasePublic/Files/2208.cDisabledForm.Pkg

File DisabledFormDemo.vw
URL=http://www.dataaccess.com/KBasePublic/Files/2208.DisabledFormDemo.vw


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.