Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug: GetFldState() and Grids?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00058853
Message ID:
00058931
Views:
34
>In any case, I tried the code you suggested and saw no change. Here is what I have in my grid.column.textbox keypress event...
>
>Do Case
> Case nKeyCode = KEY_DOWN
> wait window GetFldState(-1)
> thisform.ActiveControl.SetFocus()
> wait window GetFldState(-1)
>EndCase
>
>When the code runs, GetFldState returns "1111" both before and after the SetFocus.
Michael,

You can agree or disagree as you like, I am only reporting what has been said by the people who designed it and they get the final say on these things <g>.

One flaw I see in your logic is this, if the keypress event of the textbox is running then by definition the textbox has not lostfocus and it cannot loose focus until that code finishes. So doing this in the keypress is the wrong place to do it. You could try moving it to the Valid or lostfocus of the textbox, in whihc case you would not need the setfocus call because the control's vlaid has fired before you are checking the getfldstate.

IOW, the textbox valid will never fire before the textbox keypress, if you must check this stuff in the keypress then you ahe to account for the fact that the control's whose keypress is running has not yet updated its controlsource and so you need to check;

lcFldState = GetFldState(-1)
IF OR THIS.Value <> EVALUATE(THIS.ControlSoucre)
* Some field has changed
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform