Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Setting the date to show on the Month calendar

OI10

I have this code to set the date but is always showing , what am I doing wrong.

Qualify = ""
Qualify<1> = 1 ; // Enable OLE event
Qualify<4> = 2 ; // Synchronous event processing
Ctrl=@Window:".SRP_DATE_PICKER"
Send_Message(Ctrl, "QUALIFY_EVENT", "OnDblClick", Qualify)

Set_Property_only(Ctrl, "OLE.Selection", default)
call forward_event()

Comments

  • I can't say for sure since you aren't showing us what the default variable contains. One option is to try doing an asynchronous event. I never do synchronous events for clicks.
  • edited September 2019
    default = 18776

    How do you know when to use asynchronous or synchronous ?
    I just have that setup for all the qualify events .
    what should the value in Qualify<4> be for asynchronous .
    Is asynchronous a better default. I just copied the Qualify setup from somewhere.
  • Synchronous event handling means the control is "suspended" while OI handles the event. Synchronous is only necessary for events like BeforeUpdate, i.e., events that let you cancel an operation. Events not designed to be synchronous, like click and double-click events, can behave in unexpected ways if you try to change the state of the control while it's suspended.

    To make it asynchronous, omit Qualify<4> or set it to "".
  • Looks like I must also be changing the month and year, somewhere?? because if the date is in this month it is highlighted.
    If previous month the shows in previous month if I arrow to it.
  • edited September 2019
    The example seems to show it is as simple as:

    / Set the selection to today's date Set_Property(@Window:".OLE_DATEPICKER", "OLE.Selection", Date())
  • edited September 2019
    < deleted post >
  • Looks like I must also be changing the month and year, somewhere?? because if the date is in this month it is highlighted.
    If previous month the shows in previous month if I arrow to it.

    On the money there Barry. The selected date and the displayed month/s are separate properties so if you are going to default the selected date then I would suggest also defaulting the "FirstMonth" property to the month of the selected date. The default display is this month.
  • Cool, thanks.
    Did not pick Firstmonth as being the relevant property.
Sign In or Register to comment.