Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ActiveX calendar control not updating bound data field
Message
 
 
À
19/01/2006 15:42:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Novell 6.x
Database:
Visual FoxPro
Divers
Thread ID:
01088614
Message ID:
01088623
Vues:
9
Instead of using ActiveX you may want to check Re: Calendar Control Thread #799604 Message #799618 I have it implemented here in a class consisting of a textbox and a nice calendar button.

>I've added code from the ...\Samples\Solution\Ffc\datacal.scx form to a form I've created. A button triggers the code, which shows the calendar control. But when I change the date, nothing happens. The bound data field is not updated, and [obviously] the textbox control whose record source is the same field is not updated. Is there a bug with this, or am I just doing something wrong? See code below... Thanks!
>
>********** cmdButton.click procedure  ***************************
>#DEFINE C_CALCAPTION_LOC	"Date Override Calendar"
>lcDateTime = ALLTRIM(TTOC(DATETIME()))
>
>***************************************************************************************
>*** Code to generate calendar control for overriding current date in recovery process.*
>***************************************************************************************
>oCalForm = Create('form')
>oCalForm.NewObject("oleCalendar","_olecalendar","..\triggers app\FFC\_datetime.vcx")
>*!*	oCalForm.NewObject("oleCalendar","_olecalendar",HOME()+"FFC\_datetime.vcx")
>WITH oCalForm.oleCalendar
>	.date_column = "triggers.proc_date"
>	.RefreshDisplay()
>	.BackColor = THISFORM.BackColor
>	.Visible = .T.
>ENDWITH
>WITH oCalForm
>	.AutoCenter = .T.
>	.BorderStyle = 2
>	.MaxButton = .F.
>	.MinButton = .F.
>	.Height = oCalForm.oleCalendar.Height
>	.Width = oCalForm.oleCalendar.Width
>	.Caption = C_CALCAPTION_LOC
>ENDWITH
>
>oCalForm.Show(1)
>THISFORM.Refresh
>
>********** _olecalendar.SelChange procedure (which I have not modified)  ***********
>*** ActiveX Control Event ***
>LPARAMETERS startdate, enddate, cancel
>
>nYear = YEAR(startdate)
>nDay = DAY(startdate)
>nMonth = MONTH(startdate)
>
>dValue = DATE(m.nYear, m.nMonth, m.nDay)
>
>cColumn = THIS.date_column
>
>IF !EMPTY(m.cColumn)
>	REPLACE &cColumn WITH m.dValue
>ENDIF
>
>IF TYPE("THISFORM")="O"
>	THISFORM.Refresh
>ENDIF
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform