Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - [SOLVED] Deselect for DatePicker seems non-op
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Deselect for DatePicker seems non-op

 Post Reply Post Reply
Author
Message
Mr.Den View Drop Down
Groupie
Groupie
Avatar

Joined: 26 August 2007
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mr.Den Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Deselect for DatePicker seems non-op
    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
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post Posted: 06 January 2009 at 7:45am
Hello,
 
Try to add a DatePicker1.RedrawControl after de Deselect command.
 
It works for me.
 
Back to Top
Mr.Den View Drop Down
Groupie
Groupie
Avatar

Joined: 26 August 2007
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mr.Den Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2009 at 12:50am
No, timer not used for this case
Back to Top
dentor View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2005
Location: France
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote dentor Quote  Post ReplyReply Direct Link To This Post 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.
 
  
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.234 seconds.