CREATE CONTROL Example


Example:

 

*

 

 

.Define the CONTROL, BUTTON, and other variables

.

 

 

CAL

CONTROL

 

BUTTON

BUTTON

 

DATE

DIM

20

RESULT

INTEGER

1

*

 

 

.Create the Calendar Control

.

 

 

  

CREATE

CAL=3:20:18:62,CLASS="MSCAL.Calendar.7":

  

  

 *GridCellEffect=2

  

ACTIVATE

CAL

*

 

 

.Create and Activate the Quit Button

.

 

 

  

CREATE

BUTTON=24:25:37:43,"Quit",DEFAULT

  

ACTIVATE

BUTTON,END,RESULT

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

EVENTWAIT

 

  

REPEAT

 

*

 

 

.Show the Date Selected and Terminate

.

 

 

END

 

 

  

GETPROP

CAL,*Value=DATE

  

DISPLAY

*P1:22,"The date selected was: ",DATE,*W3

  

STOP

 

 

This example creates a calendar control and a Quit button. The user may interact with the calendar control to select a date. When the Quit BUTTON is clicked, the selected date is displayed and the program terminates.

 

 



PL/B Language Reference CREATE CONTAINER Example CREATE DATALIST Example