Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh of grid in timer event grabs focus
Message
From
06/06/2010 17:34:27
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01467580
Message ID:
01467589
Views:
35
>>>>Update: I commented out the grid refreshes and focus still jumps off and back on the textbox in the other form when my timer fires...
>>>>
>>>>I have a form with two grids (readonly) that has a timer and every 10 seconds it moves records from one table to another. both tables are displayed in separate grids on the form with the timer. when the timer is finished running if any records were moved, it refresh the two grids. If a textbox on another form has focus and the user is typing data into it, when the timer on my form runs and it hits the grid refresh command, focus jumps off of the textbox on the other form and then after the grids refresh, focus returns back to it. when focus is returned to it, the cursor is at the beginning of the textbox so what the user is typing gets shoved into the front of what they had already typed.
>>>>
>>>>Normally I would handle this in the gotfocus of the textbox.
>>>>
>>>>how can I prevent the refresh of the grids from taking focus? I don't want to mess with the gotfocus of the textbox in the other form (there is already code in there it is a very key field on a primary form with a lot of baseclass code). I prefer to handle this entirely on myform if i can.
>>>>
>>>>any ideas?
>>>
>>>How about disabling the timer in textbox.GotFocus and enabling it back in LostFocus ?
>>
>>I wish I could, but that form is a primary form of about 10 forms that are always up and visible and active. That textbox is a key control that should always have focus if the user is not typing in another control on another form. Focus is always on that control and if I do that, the timer will never run on my form.
>
>You can also try to remember the current SetLength of the textbox and try to restore it.

Tried that too. I just tried refreshing just the container (no luck) and I tried not selecting the tables ever (just moving through them in another work area) and everytime the timer fires it grabs focus regardless as soon as I touch the tables in any way - even without the refresh of the grids.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform