Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Credit card swipe
Message
From
05/03/2010 11:46:56
 
 
To
04/03/2010 22:33:07
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01451846
Message ID:
01452824
Views:
103
>>>>>>I'm using an edit box to capture the swiped data. Two questions:
>>>>>>
>>>>>>1. I don't want the user to see the edit box. However, if I set visible .f., it will not accept data.
>>>>>>
>>>>>>2. With the edit box, I do not want the user to key in data, except for Escape or perhaps a '1', but otherwise I want nothing to happen if he doesn't follow instructions and keys in other data. How do I do that?
>>>>>>
>>>>>>Thanks,
>>>>>>
>>>>>>Yossi
>>>>>
>>>>>May be you set editbox position to -100, -100 (for example), so user would not see it?
>>>>Thanks. Now how about my 2nd question? :)
>>>
>>>Set the Editbox
>>>
>>>Enabled = .F. and
>>>
>>>DisabledBackColor = DisabledForeColor
>>>
>>>That way he /she cannot type anything and also cannot see anything. If you really need any user input, then use another editbox or textbox for that. More control then over what to use and discard.
>>
>>Bernard:
>>
>>If I disable the edit box, it will not accept the credit card swipe!
>>Also, I do not want to use another text box, since that would force the user to tab over. All I want the user to see is the label saying 'swipe the credit card or press escape to cancel or press '1' to enter credit card data manually'. I want to reject all other input.
>
>Since you are using a Keyboard wedge( simulates a keyboard) you are right in that it will not allow input if disabled.
>
>You can trap Escape and 1 by setting the form.keypreview = .T. and then place code in the form.Keypress to handle this.
>
>To still use an EDIT box, keep it enabled and not show the user the data coming in do this:
>
>* Editbox
>Enabled = .T.
>ForeColor = RGB(255,255,255)
>BackColor = RGB(255,255,255)
>TabStop = .F.
>
>Add a shape control and size it exactly the size of the editbox.
>Set these properties
>
>BackStyle = 0 - Transparent
>BorderStyle = 0 - Transparent
>
>Now, at runtime, the editbox is visible but the user cannot select it nor TAB to it. It accepts text and does not show its contents.
>
>HTH

Bernard:

I'll do a test on the keypress stuff.

But it seems to me that as far as making the edit box invisible, Naomi's suggestion of .left = -100 is simpler.
Previous
Reply
Map
View

Click here to load this message in the networking platform