Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Visual Dbase > Re: LostFocus E...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 38 of 132
Post > Topic >>

Re: LostFocus Event help

by "Steve Gerrard" <notstevegerrard@[EMAIL PROTECTED] > Dec 14, 2003 at 10:53 AM

"Bob Butler" <butlerbob@[EMAIL PROTECTED]
> wrote in message
news:fa10fb0.0312140710.786efad4@[EMAIL PROTECTED]
> "Randi" <RSaddler@[EMAIL PROTECTED]
> wrote in message
news:<R9TCb.11784$JW3.8837@[EMAIL PROTECTED]
>...
> > Hi All,
> > I have a problem on a username password login form.  I use:
> > txtPassword.Text = StrConv(txtPassword.Text, vbProperCase) to
validate the
> > proper case when someone enters their name and password.  It work
when you
> > use the button to continue, but if you hit enter on your keyboard
the event
> > apparently doesnt lose focus and it says you entered the wrong
password.
>
> Neither the LostFocus nor Validate events are reliable IMO because
> they do not fire consistently.  Clicking toolbar buttons, menu items
> and pressing enter to trigger the default command button are just a
> few cases where they don't happen.  You can use them for simple
> validation if you want but never assume that they will run.  In this
> case, have the command button code do the StrConv.

I would say the events are reliable, but that controls don't lose focus
in some situations where you might expect them to. I agree that you
should never assume they will be fired, and always put required
processing in a procedure that will definitely run.

LostFocus doesn't fire here because in fact, the textbox never loses
focus. If the default button only popped up a message, focus would
return to the textbox, not the default command button. Similarly,
Validate doesn't fire because it only fires just before a possible loss
of focus.

In many cases, it makes sense that selecting a menu or toolbar button
does not change the focus. If I click the Paste button, for instance, I
appreciate the fact that the focus stays where it is, and the paste
occurs where I intended it.
 




 4 Posts in Topic:
LostFocus Event help
"Randi" <RSa  2003-12-14 06:10:57 
Re: LostFocus Event help
"BeastFish" <  2003-12-14 02:49:10 
Re: LostFocus Event help
butlerbob@[EMAIL PROTECTE  2003-12-14 07:10:36 
Re: LostFocus Event help
"Steve Gerrard"  2003-12-14 10:53:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 5:57:11 CST 2008.