>>>Hi everybody,
>>>
>>>I already built a form with all the controls using the regular VPM textbox_ class.
>>>
>>>Now, on the form I have several from / to dates controls.
>>>
>>
>>And you didn't use a re-usable container class with from/to date textboxes in ?
>>
>
>No, I didn't. At my former work I did have such a container and it took me some time to design it. In VPME we don't have it out of the box, besides, I used a form builder to put all the controls.
>
>>
>>>I'm thinking what would be the best way to add a validation logic for from/to? Does the idea of putting the logic into Ok button for the form sounds OK, e.g. don't catch the wrong dates before the final exit?
>>>
>>>This would be the easiest thing to apply then.
>>
>>
>>Maybe you can fiddle with bindevents() - but I find it clumsy
>>
>
>Agreed, so I dismissed this idea.
>
>>The quickest is to put the logic in your OK or OK.When()
>>Work with a loop that tests one pair at a time
>>
>>
>
>Exactly, that's what I decided to use with almost direct coding (call form's method for each pair).
>
>I don't like it 100%, but that's the simplest solution.
A container is reusable in other future scenarios
>
>>But a reusable container with from/to would be second to none
Update
The containers can give a warning (wait window nowait) if from > to
The OK then calls all Container.Valid(), if anyone fails it does not save
>>>Any other ideas?
>>>
>>>Thanks.
>
>Thanks again.
I was just updating and it wouldn't lt me - see in-line
Gregory