Wednesday, November 25, 2009

Mandatory dialog field

How to set up mandatory property on dialog fields.
( Dialog field property )


Control method of DialogField class returns an object which need to by assigned to a proper system class which states for used dialog field (date fields -> FormDateControl, string fields -> FormStringControl).
Thanks to these system classes You can get acces to a certain property of Your need.



static void mandatoryDialog(Args _args)
{
Dialog      dialog;
DialogField dfTransDate;
FormDateControl dateControl;
;
dialog      = new Dialog("Mandatory dialog field");
dfTransDate = dialog.addField(typeid(TransDate));
dateControl = dfTransDate.control();
dateControl.mandatory(true);

dialog.run();
}

Michael.