Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_CUROBJ to ActiveControl
Message
From
06/01/1998 15:07:08
 
 
To
06/01/1998 14:56:12
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00069672
Message ID:
00069871
Views:
42
>>>>I use the up & downarrow keys to toggle through records. With FPW I could use the
>>>>_CUROBJ=OBJNUM(FieldName) to return the cursor to the current field. I know with
>>>>VFP5 I should use the ActiveControl property but I'm not sure how it's used. I'm
>>>>inserting the code in the keypress method.
>>>>
>>>>TIA
>>>>
>>>>Chris
>>>
>>>If you gonna do something with other objects and then return to curobj set a form property to hold the reference - say oCurObject :
>>>
>>>*
>>>* Keypress event
>>>thisform.oCurObject = this && Save the reference
>>>...
>>>thisform.oCurObject.setfocus()
>>
>>I have 3 text boxes on the form (Text1, Text2, Text3)
>>
>>I tried this in the keypress event for Text2
>>
>>IF nKeyCode=24
>> SKIP 1
>> IF EOF()
>> GO BOTTOM
>> ENDIF
>> This.Text2.SetFocus
>>ENDIF
>>
>>It jumps to the next field (Text3 - tabindex 3) but
>>if I use this in keypress event
>>
>>IF nKeyCode=24
>> SKIP 1
>> IF EOF()
>> GO BOTTOM
>> ENDIF
>> This.Text1.SetFocus
>>ENDIF
>>
>>It returns the cursor to Text2. Is there a way I could say return cursor
>>to TabIndex-1 or am I just missing something?
>nKeyCode= 24 DnArrow ? Well doesn't matter.
>Just add a "nodefault" after if ..

I'm not sure if I follow you on this one. nKeyCode is a keypress parameter and
24 is INKEY() value for the DnArrow. I'm using a CASE statement because I check
for other keypress values but for simplicity I used an IF example.

So for the above code I would press the DnArrow key, display the next value and
return to the Text2 object.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform