Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If they are free?
Message
From
17/08/2006 10:17:00
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01142500
Message ID:
01146371
Views:
17
Hi Mike,

Using the code below, do you know how to determine what date is currently selected on the calendar? For example, if I run the code below and then click on GOTO date and enter 09/01/2006 the calendar goes to the correct date, but how to display that value (the current selected date in the calendar control) in a separate label on the form?
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
	Top = 0
	Left = 0
	Height = 506
	Width = 840
	DoCreate = .T.
	Caption = "Calendar Example Form"
	Name = "ouform"
	ADD OBJECT label1 AS label WITH ;
	    TOP = 8, ;
	    LEFT = 180, ;
	    HEIGHT = 30, ;
	    WIDTH = 260, ;
	    NAME = 'label1',;
	    FONTSIZE = 16, ;
	    CAPTION = "Today's Date: "+DTOC(DATE())
	ADD OBJECT olecontrol1 AS olecontrol WITH ;
		Top = 62, ;
		Left = 5, ;
		Height = 420, ;
		Width = 550, ;
		Name = "Olecontrol1", ;
		OleClass = "OVCtl.OVCtl.1"
	ADD OBJECT command1 AS commandbutton WITH ;
		AutoSize = .T., ;
		Top = 254, ;
		Left = 568, ;
		Height = 27, ;
		Width = 115, ;
		Caption = "New Appointment", ;
		Name = "Command1"
	ADD OBJECT command2 AS commandbutton WITH ;
		AutoSize = .T., ;
		Top = 302, ;
		Left = 568, ;
		Height = 27, ;
		Width = 95, ;
		Caption = "Address Book", ;
		Name = "Command2"
	ADD OBJECT cmdbutton AS commandbutton WITH ;
		Top = 350, ;
		LEFT = 568,;
		WIDTH = 75,;
		HEIGHT = 27,;
		NAME = 'cmdbutton',;
		caption = 'GOTO Date'
	ADD OBJECT optiongroup1 AS optiongroup WITH ;
		AutoSize = .F., ;
		ButtonCount = 7, ;
		Value = 1, ;
		Height = 141, ;
		Left = 568, ;
		Top = 74, ;
		Width = 240, ;
		Name = "Optiongroup1", ;
		Option1.Caption = "Day/Week/Month", ;
		Option1.Value = 1, ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Style = 0, ;
		Option1.Top = 5, ;
		Option1.Width = 204, ;
		Option1.AutoSize = .F., ;
		Option1.Name = "Option1", ;
		Option2.Caption = "Day/Week/Month View With AutoPreview", ;
		Option2.Height = 17, ;
		Option2.Left = 5, ;
		Option2.Style = 0, ;
		Option2.Top = 24, ;
		Option2.Width = 235, ;
		Option2.AutoSize = .T., ;
		Option2.Name = "Option2", ;
		Option3.Caption = "Active Appointments", ;
		Option3.Height = 17, ;
		Option3.Left = 5, ;
		Option3.Style = 0, ;
		Option3.Top = 43, ;
		Option3.Width = 204, ;
		Option3.AutoSize = .F., ;
		Option3.Name = "Option3", ;
		Option4.Caption = "Events", ;
		Option4.Height = 17, ;
		Option4.Left = 5, ;
		Option4.Style = 0, ;
		Option4.Top = 62, ;
		Option4.Width = 204, ;
		Option4.AutoSize = .F., ;
		Option4.Name = "Option4", ;
		Option5.Caption = "Annual Events", ;
		Option5.Height = 17, ;
		Option5.Left = 5, ;
		Option5.Style = 0, ;
		Option5.Top = 81, ;
		Option5.Width = 204, ;
		Option5.AutoSize = .F., ;
		Option5.Name = "Option5", ;
		Option6.Caption = "Recurring Appointments", ;
		Option6.Height = 17, ;
		Option6.Left = 5, ;
		Option6.Style = 0, ;
		Option6.Top = 100, ;
		Option6.Width = 204, ;
		Option6.AutoSize = .F., ;
		Option6.Name = "Option6", ;
		Option7.Caption = "By Category", ;
		Option7.Height = 17, ;
		Option7.Left = 5, ;
		Option7.Style = 0, ;
		Option7.Top = 119, ;
		Option7.Width = 204, ;
		Option7.AutoSize = .F., ;
		Option7.Name = "Option7"
	PROCEDURE Init
		thisform.oLECONTROL1.Folder="Calendar"
		thisform.oLECONTROL1.gotoDate("01/01/2000")
	ENDPROC
	PROCEDURE command1.Click
		thisform.OLECONTROL1.newAppointment()
	ENDPROC
	PROCEDURE command2.Click
		thisform.OLECONTROL1.addressbook()
	ENDPROC
        PROCEDURE optiongroup1.Option1.Click
		thisform.OLECONTROL1.view = this.Caption 
	ENDPROC
	PROCEDURE optiongroup1.Option2.Click
		thisform.OLECONTROL1.view = this.Caption 
	ENDPROC
	PROCEDURE optiongroup1.Option3.Click
		thisform.OLECONTROL1.view = this.Caption 
	ENDPROC
	PROCEDURE optiongroup1.Option4.Click
		thisform.OLECONTROL1.view = this.Caption 
	ENDPROC
	PROCEDURE optiongroup1.Option5.Click
		thisform.OLECONTROL1.view = this.Caption 
	ENDPROC
	PROCEDURE optiongroup1.Option6.Click
		thisform.OLECONTROL1.view = this.Caption 
	ENDPROC
	PROCEDURE optiongroup1.Option7.Click
		thisform.OLECONTROL1.view = this.Caption 
	ENDPROC
	PROCEDURE cmdbutton.click
		mydate = DTOC(DATE())
		mydate = INPUTBOX('Enter date: ','GOTO date',mydate)
		IF TYPE('mydate') = "C" .and. CTOD(mydate) > {}
			thisform.OLECONTROL1.gotoDate(mydate)
		ELSE
			MESSAGEBOX('Invalid Date Entered.')
		ENDIF
		thisform.OLECONTROL1.setfocus()
	ENDPROC
ENDDEFINE
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform