[Gambas-user] how to set a specific day in datechooser component

PICCORO McKAY Lenz mckaygerhard at ...626...
Fri Jan 31 19:41:57 CET 2014


> From: Tobias Boege <taboege at ...626...>
> You have to do that yourself (let dtcDate be your DateChooser):
¬_¬u

> Public Sub dtcDate_Change()
>   dtcDate.Value = Max(Now(), dtcDate.Value)
> End
> Alas, the DateChooser does not support Stop Event in the Change event, so
> I always reset the dtcDate.Value to Now() when the user chose a past date.
so then better not limit the days,
and only verified if the date choosen by user
are the permited by program... more easy and less complicated
Thanks any way

> If you want to reset the date to what the user had chosen before, you must
> save that value after each succeeding dtcDate_Change() and change the event
> handler in the obvious ways...
no that not interest to me..

> (Maybe the above code works because of a bug: it's generally dangerous to
> change the value of something during its Change event. To be future-proof
> you would wrap the line above into Object.Lock(Last) and Object.Unlock(Last)
> lines. Benoit?)
i corroborarte that, i have recursive calls now ^_^




More information about the User mailing list