Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Vilhelm-Ion Praisach
  Where is Vilhelm-Ion Praisach?
 Resita
 Romania
 Vilhelm-Ion Praisach
 To: Bob Gatto
  Where is Bob Gatto?
 Hawthorne
 New Jersey - United States
 Bob Gatto
 Tags
Subject: RE: disable/enable the DTPicker
Thread ID: 396091 Message ID: 396097 # Views: 52 # Ratings: 7
Version: Visual FoxPro 9 SP2 Category: Active X Controls & OLE Automation
Date: Wednesday, January 22, 2014 8:34:05 PM         
   


> Hello One And All,
>
> I'm using the Microsoft Date and Time Picker ActiveX on my form. At certain times I want the DT picker to be enabled and others I want it to be disabled. And when I say disabled, I mean the user cannot even bring up the calendar image to select from. When I set the Enabled property to .F. that only stops a user from manually entering a date into the field.
>
> So how can I programmatically make it so sometimes the user can bring up the calendar image and sometime they can't?
>
> Thanks for any help.
>
> Bob Gatto

use
MyDtPicker.OBJECT.Enabled

instead of
MyDtPicker.Enabled


Demo:

PUBLIC oFrm
oFrm=CREATEOBJECT("MyForm")
oFrm.show()

DEFINE CLASS MyForm as Form
	ADD OBJECT MyDtPicker as OleControl WITH OleClass="MsComCtl2.DtPicker.2",height=30
	ADD OBJECT MyChk as CheckBox WITH Top=50,Caption="Enabled",value=.T.,autosize=.T.
	PROCEDURE MyChk.InteractiveChange
		ThisForm.MyDtPicker.OBJECT.Enabled=This.Value
	ENDPROC
ENDDEFINE



My respects

ENTIRE THREAD

disable/enable the DTPicker Posted by Bob Gatto @ 1/22/2014 8:13:07 PM
RE: disable/enable the DTPicker Posted by Vilhelm-Ion Praisach @ 1/22/2014 8:34:05 PM