Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change color when skipping
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00095050
Message ID:
00095297
Views:
28
The major problem is : ControlSource Property of text box class can't accept non-data type. Vfp's help said only column class can do that. Therefore, Code(field) is unacceptable in controlsource. I can encode and decode the value but can't display or accept it.

I tried to change the controlsource property in txtbox.Refresh() but didn't work because change controlsource also change the display of text. On the other hand, text box class will display the value without convertion. So, the user will see funny chars.

Sunny

>>The user input normal text, eg. 'Computer', into text box. The user still see the normal text. Then, when he click [Save]. The box will convert to encryed text, eg. '%$@!*8', automatically to save it in table. When retrieve it to read, the box will convert it back to 'Computer' and let the user read it. The box is very useful for security propose. Althought someone steal the data or program, he can't read it without password.
>>
>>Any suggestion are appreciated.
>>
>>Sunny
>>
>>>>Is there a way/event to test the changes of value when skipping? I tried 'programmmatic change event' and 'interchange event'. They didn't fit my needs.
>>>>
>>>>If you knew such event, please tell me. It is very helpful to create a 'encryed txtbox'.
>>>>
>>>>I always have a problem in creating a 'encryed txtbox'. It can display encryed data into normal text and then accept normal text and convert it to encryed text.
>>>>
>>>>Sunny
>>>>
>>>>>>Txtbox has no such events. Is there any other way to do that?
>>>>>>
>>>>>>Sunny
>>>>>>
>>>>>
>>>>>If you are using a 'Next' button then you must be doing some processing to get the next record - in here you can specify the color of the textbox before you refresh it. I'm not sure if you can specify it as xxx,xxx,xxx - if not, it is stored as a very long number (try manually changing to red-on-white then writing the value to a variable and use debugger to display the variable - this will tell you what to change it to). Then your 'Next' button can change the foregroundcolor of the textbox.
>>>
>>>What is 'encryed txtbox'? Please elaborate.
>
>Ah, I got your problem.
>
>Encrypting data is up to the programmer on what formula he/she want to use.
>
>Here is an example:
>
>Thisform.txtPassword.Value = 'YUNGHUNG'
>
>I should have a routine like this:
>
>FUNCTION Decoder
>PARAMETERS thispass, passflag
>* where: thispass is the password inputted
>* passflag , logical value ( .T. if you want to encrypt, .F. back to normal)
>
>STORE "" TO finecode,mycoder
>FOR i = 1 TO LEN(ALLT(thispass))
> * minus 11 to encrypt the file so that unreadable
> * plus 11 back to normal to make it readable
> * with conversion to ASCII code to make it saveable to the my field
> IF !passflag
> mycoder = CHR(ASC(SUBSTR(thispass,i,1))-11)
> ELSE
> mycoder = CHR(ASC(SUBSTR(thispass,i,1))+11)
> ENDIF (!passflag)
> finecode = finecode+mycoder
>NEXT (i)
>RETURN finecode
>
>How to use it?
>
>* encrypting
>mypassword = DECODER(Thisform.txtPassword.Value,.T.)
>
>REPLACE user.password WITH mypassword
>
>* back to normal
>
>mypassword = DECODER(user.password,.F.)
>
>Thisform.txtpassword.Value = mypassword
>
>Hope this helps
Can you live without the earth?
Please remind that :
"Yung Hung" is my first name;
"Yeung" is my last/family name.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform