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

Caldendar Resource

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

Joined: 14 April 2010
Location: Australia
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote cannones Quote  Post ReplyReply Direct Link To This Post Topic: Caldendar Resource
    Posted: 14 October 2010 at 11:29am
Hi All,

Does anyone have any pseudo code on how to add resources to a calendar. Essentially all I want to do is show a single date with columns of resource names then add any bookings they may have in the relevant resource column.

You practically require a GPS to navigate through this control. It needs to be explained in plain english together what steps are required ..

Regards,
Sam

Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 19 October 2010 at 5:41am
Hi

To be honest you should be able to pick apart the code from the code examples, I do unserstand what you mean about this control as it's full of features and there's a lot to it. But you should be able to take what you need from the examples and anything else from this forum.

But here is some code on how I add events to the Calendar Control:


    Dim m_pEvent As CalendarEvent

    ' Create a New event for the Calendar
    Set m_pEvent = CalendarControl.DataProvider.CreateEvent

    ' The following code will add an All Day Event which appears at the top of the Calendar for a given date.
    With m_pEvent
        .StartTime = <Start Date Time Goes Here>
        .EndTime = <End Date Time Goes Here>
        .Subject = <Subject Title Goes Here>
        .Body = <Body Text Goes Here>
        .AllDayEvent = True
        .Label = 10    ' Gives the Event a Colour... The colours are from 1 to 10
    End With

    CalendarControl.DataProvider.AddEvent m_pEvent

    ' Create a New event for the Calendar
    Set m_pEvent = CalendarControl.DataProvider.CreateEvent

    ' The following code will add an Event which appears in the Calendar for a given date.
    With m_pEvent
        .StartTime = <Start Date Time Goes Here>
        .EndTime = <End Date Time Goes Here>
        .Subject = <Subject Title Goes Here>
        .Body = <Body Text Goes Here>
    End With

    CalendarControl.DataProvider.AddEvent m_pEvent

    ' Notes:
    ' AllDayEvent defaults as false therefore is only required to add an AllDayEvent
    ' You don't have to pass a Label Colour, it has a default colour if nothing is passed

    ' The m_pEvent variable used has many more useful events built in, but the above should give you the basics on how to add two types of events to the Calendar Control




I hope this helps.
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
cannones View Drop Down
Groupie
Groupie
Avatar

Joined: 14 April 2010
Location: Australia
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote cannones Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2010 at 9:22pm
Hi ,

Thanks you for the snippet .. I actually do have the loading of standard events going. One of the issues I am having is when loading resources.

I used to use the dbi scheduling controls which in relation to understanding the codejock calendar control was like walking to the local shop rather than flying to the moon. 

In my application I only want to display either a 7 day work week or a single day. In the single day view I display all the resources together with what appointment/events they have for that day.

When I switch to 7 day work week I want to display all the appointments/events for that week , but not have the resources appear in the calendar.

So what I need to know is how to I remove all the resources before changing the view type back to a 7 day work week..

I have tried to call the RemoveAll  of the CalendarResourcesManager but the resources still appear..

What am I doing wrong ..

Sam
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.141 seconds.