Print Page | Close Window

[SOLVED] Deselect for DatePicker seems non-op

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=13082
Printed Date: 08 May 2024 at 9:05pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Deselect for DatePicker seems non-op
Posted By: Mr.Den
Subject: [SOLVED] Deselect for DatePicker seems non-op
Date Posted: 06 January 2009 at 7:31am
Add a datepicker to a form, and execute the code:
 
DatePicker1.Select "1/1/2009"
 
As expected 1/1/2009 is selected.
 
Execute the code:
 
DatePicker1.Deselect "1/1/2009"
 
And 1/1/2009 remains selected.
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 16.3.1

Platform: Windows 7 Professional (64bit) - SP 1

Language: Visual Basic 6.0 SP 6



Replies:
Posted By: dentor
Date Posted: 06 January 2009 at 7:45am
Hello,
 
Try to add a DatePicker1.RedrawControl after de Deselect command.
 
It works for me.
 


Posted By: Mr.Den
Date Posted: 06 January 2009 at 10:40am

Thank you for that, it works fine.

I did not see any reference to having to redraw the control in the help file



-------------
Product: Xtreme SuitePro (ActiveX) version 16.3.1

Platform: Windows 7 Professional (64bit) - SP 1

Language: Visual Basic 6.0 SP 6


Posted By: mdoubson
Date Posted: 09 January 2009 at 12:41am
No - you don't need to call redraw - e.g. I check MFC ReportSample with test code:

CXTPDatePickerControl* pDatePicker = &((CMainFrame*)GetParentFrame())->m_dlgDatePicker.m_wndDatePicker;

if (pDatePicker)

{

pDatePicker->Select(COleDateTime(2009,2,2,0,0,0));

pDatePicker->Deselect(COleDateTime(2009,2,4,0,0,0));

}

and it redraw itself (maybe there is some running timer)


Posted By: mdoubson
Date Posted: 09 January 2009 at 12:50am
No, timer not used for this case


Posted By: dentor
Date Posted: 09 January 2009 at 2:01am
You're right Mdoubson.
 
If you select another day in the DatePicker, there is no need to call Redraw after the Deselect call.
 
But If you don't select another day, the Deselect call doesn't not refresh the DatePicker until you call Redraw or refresh the DatePicker by selecting a date.
 
So we're  both right.
 
  



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net