Step 3. Make the Find Image Form Useful
VFW080 – Using an Explorer Component
1. Switch to the
tab. Define an event with a map for input of class STD_STRNG:Define_Evt Name(uImageSelected)
Define_Map For(*input) Class(#std_strng) Name(#uFilename)
The event, when signalled, will pass the full filename for the selected image.
2. Create an
event for Explorer DCBX_2, using the view and the context menu on DCBX_2:Evtroutine Handling(#DCBX_2.ItemGotSelection) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Endroutine
3. This routine should set the
property for the Image component (IMGE_1) from the Explorer DCBX_2, Path and Filename Your code should look like the following:#IMGE_1.fileName := #DCBX_2.path + #DCBX_2.filename
4. In the
event routinea. Signal the
event.b. Populate the
parameter using the DCBX_2 properties.c. Then close the form.
Your
push button event should look like the following:Evtroutine Handling(#PHBN_OK.Click)
Signal Event(uImageSelected) Ufilename(#DCBX_2.path + #DCBX_2.filename)
#com_owner.closeForm
Endroutine
5. Complete the Click event, to close the form:
Push buttonEvtroutine Handling(#PHBN_CANCL.Click)
#com_owner.closeForm
Endroutine
6. Compile your form.