|
-
Mar 8th, 2002, 07:26 AM
#1
Thread Starter
Lively Member
textbox validate event does not fire
I created an activeX textbox control which is just a simple textbox control with some extra properties and stuff.
But for some reason the validate event does not fire.
I have a property called max which indicates what the maximum value is the user can enter.
Then when the control losses the focus want to fire this event.
I know I could use the lostfocus event, but what some times I will populate my new textbox with a value form a database and then the lostfocus event will not fire since I never entered the control. The value of the control was set using code.
Anyone knows how to fire the validate event?
-
Mar 9th, 2002, 06:37 PM
#2
How about from the Change event?
-
Mar 11th, 2002, 01:29 AM
#3
Thread Starter
Lively Member
Nope, thats not it.
The change event will then fire everytime the user types a key and thats not what I want. i only want to evaluate the contents of the textbox once the user completed the whole field.
Any other ideas?
-
Mar 13th, 2002, 12:19 AM
#4
New Member
This is a rather sneaky way to accomplish what you want, I think. Combine all three steps:
1) Use the lost_focus event to fire off your validate event.
2) Use the key_down event to set a module-level boolean value (call it bKeyJustPressed) to true.
3) Use the change event to check if bKeyJustPressed is true. If it's true, just set it to false and do nothing else. If it's not true, then fire off the validate event, since the value of the control was changed thru code.
Good luck.
Kevin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|