Focus difference between desktop and device

RacingDog

Active Member
Licensed User
In the default tab/panel of this app I have a table and a text box for editing the cells with. I arranged to have a timer so that after a cell selection, the focus would change to the text box. I did this as changing the focus directly isn't allowed in the SelectionChanged event.

This worked OK but had a problem when the user reselects the same cell. What happened was that the focus was then left in the table, because no event was generated to activate my code. I thought about this and realised there is a problem here in that there is no way of knowing that a cell has been reselected, there is no "got focus" event, no click event, no "has focus" boolean method. Given the number of times things turn out to be Net CF limitations, it wouldn't surprise me to find that again (which is why I posted here rather than under bugs). But anway, that is just the first thing that could be looked at.

I found a work-around. I implemented the text box's LostFocus event and simply called it's Focus method, see the commented out line in the one line sub, Value_LostFocus. This worked perfectly when I tested it on the desktop. On the device, I could no longer select cells! This needs looking at as such behaviour differences are undesirable.

However, I found a work-around for that, I replaced that one line with one which simply enabled the aforementioned timer (see that sub again). This works in both environments. So no rush for help, just issues you need to be aware of.
 

Attachments

  • Bets.zip
    15.7 KB · Views: 228
Last edited:
Top