Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Capture text box LostFocus

Posted on 1997-03-13
1
Medium Priority
?
278 Views
Last Modified: 2012-08-13
I use Crescent text box controls in 16-bit VB 4.0.  I have some code behind the text boxes' LostFocus event that need to be executed (mostly data validation).  However, when I click on one of the menu itmes in MDIOnline form, the LostFocus event of currently selected text box did not get triggered.  I tried to use SendKeys "{Tab}" in menu item click event, but the LostFocus event still did not get fired.  Can somebody provide me with a pointer?  Thanks in advance.
0
Comment
Question by:Copland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
volking earned 200 total points
ID: 1424475
First, you're never going to get the lost focus event to fire. I encounter the same problem about 10 months ago and spent almost 2 days chasing it.

My best advice is

1) move ALL validation code from ALL controls to a central SUB.

2) in each control's GotFocus event, set a global variable (of type control) to whatever control just got the focus.

3) In each control's Lost focus event, call the central sub.

Now here's the tricky part ... Since you're using Crescent's QuickPac controls (by the way I LOVE THOSE CONTROLS!) anyways, QuickPak has a control called CSForm. When you add CSForm to a form, you get a bunch of new events. The two events you're interested in are MenuBrowse and SysMenuClick.

In those two events, you also fire the Centralized SUB.

You may also want to take a look at the CtlNotify event. I played with it a bit, but to be honest, the danged thing fired too much, especially in an MDI environment.

Good luck.
============> Frederick


0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question