You are here: Retrieve the value the user keys into the control
LMD DialogPack
ContentsIndexHome
Example

For this example, drop a TLabel, TButton and TJSEditDialog component on the form. 

In the TButton.OnClick event add the following code. 

 

  Label1.Caption := '';
  if JSEditDialog1.Execute = mrOK then
    Label1.Caption := JSEditDialog1.EditValue;

 

When you run this code a TJSEditDialog will display with only the Edit control visible. Type a value into the Edit control and select the OK button. Whatever value is typed into the Edit control on the dialog, will be reflected in the label control once the dialog has closed. 

 

To expand on the first example, change the EditProperties.EditType property of the TJSEditDialog component on the form to be etCalendar. 

Run the application and click on the button again. Notice how the Label does not get updated. This is because we need to handle the OnGetEditValue event. 

 

Close the application and In the form designer generate an OnGetEditValue event for the TJSEditDialog component. 

Add the following code into the generated event. 

 

  Value := DateToStr(TMonthCalendar(AControl).Date);

 

Run the application again. This time when clicking on the button, the label is updated with whatever date is selected on the calendar from the dialog.

Copyright © 2013 by LMD Innovative. All rights reserved.
Copyright © 2013 by LMD Innovative. All rights reserved.