home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_code1
/
focus002
/
readme.now
< prev
Wrap
Text File
|
1992-05-15
|
2KB
|
42 lines
This is the revised version of the Focus U-Turn test program.
.
It demonstrates the same type of data validation techniques as the first
version, but extends it to include forms that have option buttons and
check boxes.
.
Option buttons must be handled differently because they operate as a group
of mutually-exclusive controls rather than as independent controls. In VB,
only one option button in a group can be TRUE. This is not the case when
programming in SDK/C/C++. If you are used to SDK/C/C++ option button
(a.k.a. radio button) behavior, some of the VB behavior will be different.
.
The general idea for doing data validation for option buttons is to validate
them BEFORE they are used. If the option button can be a valid choice, then
enable it; otherwise disable it.
.
The same technique is used for check boxes, although slightly modified
because check boxes DO operate as independent controls. However, they
should only be made available for use if they are valid choices.
.
In some cases, it may be necessary to add more conditions to option button
and check box groups. It is more likely that this will be the case with
check box groups than with option button groups. Option button groups must
be mutually-exclusive choices, but check box groups can be structured so
that selecting one check box automatically selects other check boxes (or
deselects them). Doing this type of automatic control selecting/deselecting
makes doing Focus U-Turns more complex.
.
After performing some extensive testing, I have concluded that it is nearly
impossible to do Focus U-Turns with a drop down combo box. Some of the
important Windows API-level messages are either ignored or given reduced
significance by VB at the event level. Doing Focus U-Turns requires certain
Windows API-level messages to be given VB event status. Focus U-Turns also
require a certain priority and sequence to these events. For combo boxes
(except drop down list box style), this does not appear to occur.
.
I do not recommend using combo boxes on forms that require 'verfiy when exit
control' type of edits. Instead, use a text box and a list box (which is
what a combo box really is).
.