[Solved] Event : BackgroundColor and Locked |
Post Reply |
Author | |
Potus
Newbie Joined: 29 March 2012 Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 12 April 2012 at 10:48am |
Hi all,
We have downloaded 15.2.1 Of Calendar Control and we have 2 questions before to buy it :
* Can you confirm me that we have only Event.Label 0 to 10 for background color of an Event ? We want more colors in our society (like it seem possible for Cells of CalendarControl).
* Is it possible to lock an event (only those we select in our developpement) ?
Regards,
Potus
|
|
Product: Xtreme SuitePro (ActiveX) version 15.2.1 Eval 30 days.
Platform: Windows Seven (64 bits) Language: C# under Visual Studio 2008 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
By default Event ID's 1-6 are already created yellow, blue, etc.... So if you add them be sure to start with ID 7 or greter or delete the default ones.
If m_bAddEvent Then m_pEditingEvent.Categories.Add 7 m_pEditingEvent.Categories.Add 8 frmInbox.wndCalendarControl.DataProvider.AddEvent m_pEditingEvent Else frmInbox.wndCalendarControl.DataProvider.ChangeEvent m_pEditingEvent End If Public Sub AddCategories() 'IDs 1-6 are used for the default colors, 1 = Yellow....6 - Blue Dim EvCat As XtremeCalendarControl.CalendarEventCategory |
|
Potus
Newbie Joined: 29 March 2012 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Thanx for your response Oleg. If you look my signature, you will see I am under CSharp.
So, I adapted you code as below (taking from your sample code of C#.NET\CalendarControl for Normal Event) :
NB: In CSharp, I can't directly modify BackGroundColor as you do In Vb.
I have assing in enum Label (frmEventProperties) this NewColor (with 11), but there is somewhere an mistake I don't see. Could you help me ? I am sure I am near the solution, sorry If it's an big stupid thing I have missed (I am not expert and so alone on this project in my society).
And what about the second question (lock event) you can tell me if the property exists?
Best Regards,
Potus
|
|
Product: Xtreme SuitePro (ActiveX) version 15.2.1 Eval 30 days.
Platform: Windows Seven (64 bits) Language: C# under Visual Studio 2008 |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
I think Oleg misunderstood, here is code you need for labels:
CalendarEventLabels listLabels = wndCalendarControl.DataProvider.LabelList(); // Use to remove all built in labels and add your own /* listLabels.RemoveAll(); listLabels.AddLabel(0, 0, "None category"); listLabels.AddLabel(1, 0xff0000, "Blue category"); listLabels.AddLabel(2, 0x00ff00, "Green category"); listLabels.AddLabel(3, 0x0000ff, "Red category"); */ // Use to add labels to existing default list (0-10) /* RGB(255,255,255) None 0 RGB(255,148,132) Important 1 RGB(132,156,231) Business 2 RGB(165,222, 99) Personal 3 RGB(231,231,214) Vacation 4 RGB(255,181,115) Must Attend 5 RGB(132,239,247) Travel Required 6 RGB(214,206,132) Needs Preparation 7 RGB(198,165,247) Birthday 8 RGB(165,206,198) Anniversary 9 RGB(255,231,115) Phone Call 10 */ listLabels.AddLabel(11, 0x000001, "Black Category"); listLabels.AddLabel(12, 0xff0000, "Blue category"); listLabels.AddLabel(13, 0x00ff00, "Green category"); listLabels.AddLabel(14, 0x0000ff, "Red category"); // Create 4 normal events // Normal Event 1 CalendarEvent ptrEvent = pCalendarData.CreateEvent(); ptrEvent.StartTime = dtNow; ptrEvent.EndTime = dtNow.AddHours(1); ptrEvent.Subject = "Event &Now [Tentative Meeting]"; ptrEvent.Location = "MSB - Room 204"; //ptrEvent->SetReminderMinutesBeforeStart(10); ptrEvent.BusyStatus = CalendarEventBusyStatus.xtpCalendarBusyStatusTentative; ptrEvent.MeetingFlag = true; ptrEvent.Label = 11; pCalendarData.AddEvent(ptrEvent); wndCalendarControl.Populate(); |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
for locking you can modify this code to check which event, etc...now it locks all edit operations:
Private Sub CalendarControl_BeforeEditOperation(ByVal OpParams As XtremeCalendarControl.CalendarEditOperationParameters, CancelOperation As Boolean)
CancelOperation = True Exit Sub ... Private Sub CalendarControl_IsEditOperationDisabled(ByVal OpParams As XtremeCalendarControl.CalendarEditOperationParameters, DisableOperation As Boolean) DisableOperation = True Exit Sub |
|
Potus
Newbie Joined: 29 March 2012 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Perfect Super Mario, I am continuing my investigations on this control
|
|
Product: Xtreme SuitePro (ActiveX) version 15.2.1 Eval 30 days.
Platform: Windows Seven (64 bits) Language: C# under Visual Studio 2008 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |