Re: Oracle Power Object - I need Help

From: Phil Herring <revdoc_at_uow.edu.au>
Date: 1997/06/29
Message-ID: <5p6r9a$mht$1_at_wyrm.its.uow.edu.au>#1/1


In article <33b46c03.24289281_at_news.centroin.com.br> Marcelo Lins, visual_at_centroin.com.br writes:
>Is it CORRECT or it's a BUG?

It's correct. A field's Value doesn't change until focus leaves the field. (You can verify this by overriding the PostChange() method and seeing when it get called.)

>If it's CORRECT How can i get the value of the field
>when i'm typing it (on the method OnKey), i.e. the real value of
>a textbox inside the Onkey method.

You can't, but all you want to do is know when the field has some text in it. You can do that most of the time (but not all of the time) by counting the number of keystrokes that are the backspace key, and the number of keystrokes that aren't. If the number of backspace keystrokes is less than the number of non-backspace keystrokes, then there is *probably* text in the field. However, the user can still select more than one character and delete it, so you'll still never know if there's anything in the field with 100% certainty until focus moves somewhere else. (Dealing with cut and paste in this situation is left as an exercise for the reader :-)



Copyright 1997 Phil Herring. This article may not be reproduced for profit.
Received on Sun Jun 29 1997 - 00:00:00 CEST

Original text of this message