Print Page | Close Window

Highlight date in datepicker control

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=2825
Printed Date: 11 December 2024 at 4:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Highlight date in datepicker control
Posted By: haitao
Subject: Highlight date in datepicker control
Date Posted: 31 August 2005 at 5:14pm

Hi,

  I am using Access 2003. I have a datepicker control named "datepicker" and a button control named "btnToday" on a form. What i want is that if "btntoday" is clicked, "datepicker" set selection to today's date. I put following code into btntoday_click()

Me!DatePicker.EnsureVisible Date

Me!DatePicker.SelectRange Date, Date

It works only if today's date is not visible.

Thanks!




Replies:
Posted By: sserge
Date Posted: 01 September 2005 at 9:24am
Hi,

Actually, you should redraw the control after calling this method. It will work using RedrawControl() method in C++, but currently this method is unavailable for Activex. We'll add it for the nearest release, and for the current moment as a workaround you can try to use code like this:

    DatePicker.Width = DatePicker.Width + Screen.TwipsPerPixelX
    DatePicker.Width = DatePicker.Width - Screen.TwipsPerPixelX


Not beautiful, but should work.

--
WBR,
Serge


Posted By: haitao
Date Posted: 01 September 2005 at 9:38am

Thanks!

Found the Today button on datepicker control. I will go with it.




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