Consultor Eletrônico



Kbase P34698: How to access date information from the Microsoft ActiveX Ca
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/07/2003
Status: Unverified

GOAL:

How to popup the Microsoft ActiveX Calendar Control visible on the CHOOSE of a BUTTON widget and populate FILL-IN widgets using its date information?

FACT(s) (Environment):

Windows

FACT(s) (Environment):

Progress 9.x

FIX:

This solution assumes the Microsoft ActiveX Calendar Control "MSCAL.OCX" is properly registered. The following steps have been tested using Progress 9.1D, Windows XP and the ActiveX 'Microsoft Calendar Control 8.0'.

1. Start the Progress Application Builder.
2. Create a new window.
3. Drop 3 FILL-IN widgets on the Window and name them 'day', 'month' & 'year'.
4. Drop a BUTTON widget on the window and name it 'Calendar'.
5. Drop the Microsoft Calendar Control 8.0 onto the window.
6. Double Click on the Calendar Control to access its property sheet.
7. Set the Calendar Control's 'Visible' attribute to 'False'.
8. Put the following statement in the CHOOSE event trigger for the button:

chCtrlFrame:Calendar:VISIBLE = TRUE.


9. Put the following code in the OCX.Click event of the control:

DO WITH FRAME {&FRAME-NAME}:
ASSIGN
DAY:SCREEN-VALUE = STRING(chCtrlFrame:Calendar:DAY)
MONTH:SCREEN-VALUE = STRING(chCtrlFrame:Calendar:MONTH)
YEAR:SCREEN-VALUE = STRING(chCtrlFrame:Calendar:YEAR).
END.
END PROCEDURE.

10. Save the window.
11. Run the window.
12. Click the BUTTON named 'Calendar' to make the Calendar Control visible.
13. Click any where on the control to populate the FILL-IN widgets with the currently selected date information.