Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calendar Control
Message
De
15/05/2003 14:17:40
Bill Drew
Independent Consultant
Chicago, Illinois, États-Unis
 
 
À
15/05/2003 08:37:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00788245
Message ID:
00788902
Vues:
30
>Actually, I must be missing something because I have no idea what you are talking about < s >. Can you explain the behavior you are seeing so that I can understand what you are seeing and then tell me what you expect to happen instead?
>
Marcia:
Situation is this. I want to use the same calendar ocx to populate several date text boxes on a form.

I started out using several of your drop down calendars from chapter 4 of kilofox. But why ask users to drop down so many times if several dates are needed? (Ahh S.E.C. compliance offers much work for these tired hands.)

I did find your code in the afterupdate event of the calendar control as way to update the value of the active text box. It worked fine.
IF TYPE("thisform.ActiveControl.value") # "U"
     thisform.ActiveControl.value = TTOD(this.object.Value)
endi
<\Pre>

And I can synchronize the calendar with the active text box by calling this from the gotfocus of the text box.

<Pre>
lpara othiscontrol
WITH Thisform.caltrol1
	.enabled = .t.
	.controlsource = othistrol.controlsource
	.Refresh()
ENDWITH	
<\Pre>

My problem comes when I go from one text box to the next.  I can deactive the calendar in the lost focus event of the date text boxes.  But I can't see a good way to reset the calendar so that no date is selected.  This is a problem because if I tab into a second date text box and want to select the same date, the user has to first select a date that he/she doesn't want and then re-select the date which was in the previous text box.

I came up with a semi-workable solution by setting day to 1 in the various lost focus events.  (But what if the user really wants to select the first?  It is already selected and would have to be deselected before it can be selected.  Maybe I'll set it to a Sunday -- which would be out of bounds.)

Here is the method that is called from the various lost focus events:

<Pre>
with thisform.caltrol1
	.ControlSource = ""
	.day = 1
	.REFRESH()
	.enabled = .f.
endw
Just trying to get a date from you <s>

Bill
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform