Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Resync Calendar with DatePicker
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Resync Calendar with DatePicker

 Post Reply Post Reply
Author
Message
AndyWilton View Drop Down
Groupie
Groupie
Avatar

Joined: 03 June 2008
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndyWilton Quote  Post ReplyReply Direct Link To This Post Topic: Resync Calendar with DatePicker
    Posted: 22 January 2010 at 11:07am
Hi All,
 
I have a scenario where I select various different dates in the DatePicker using the 'Select' method.  The problem is that if the DatePicker is attached to a Calendar, the Calendar is not updating.
 
Eg.  We start with a scenario where both the Calendar and the DatePicker has 1st January highlighted / selected.
I then select 4th, 6th and 10th January on the DatePicker via the 'Select' method.  The DatePicker then has those dates selected BUT the Calendar is still showing the 1st of January.
 
Does anybody know of a method to tell the Calendar to Resync itself with the DatePicker.
 
 
The above obviously works if the DatePicker selections are done via the mouse, but I need to do it via code.
 
Thanks in advance.
 
Andy
 
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7
Language: Clarion 5.5 -> C8.x
======================================
Andy Wilton
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: 22 January 2010 at 6:11pm
this is working code for MFC app

COleDateTime odt1 = COleDateTime(2009,8,1,0,0,0); COleDateTime odt2 = COleDateTime(2009,9,1,0,0,0);

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

pDatePicker->SetRange(&odt1, &odt2); pDatePicker->SetSelRange(odt1, odt2);

---- all above you can do in VB
pDatePicker->GetConnection()->SendEvent(XTP_NC_DATEPICKERSELECTIONCHANGED, 0, 0);
----coud you do smth similar in VB?
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 25 January 2010 at 10:11am
You can call it, but it won't update still.  Problem is wndDatePicker.Select does not fire wndDatePicker_SelectionChanged:

    wndDatePicker.Selection.AllowNoncontinuousSelection = True
    wndDatePicker.Select "01/20/2010"
    wndDatePicker.Select "01/25/2010"
    wndDatePicker.Select "01/27/2010"
   
    Call wndDatePicker_SelectionChanged
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: 25 January 2010 at 1:51pm
https://forum.codejock.com/uploads/BetaOCX/CalendarBeta14.rar 
had new function datepicker.ResyncCalendar
 
and also modified function
datepicker.FirstWeekOfYearDays = (say 4 for Germany) to make proper Print / PrintPreview small calendars with week numbers
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.203 seconds.