We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Changes in the appearance of the control are lost when changing view

I have changed the appearance of the calendar using the properties of the ScheduleControl.Appearance. When I change the view of the calendar to days the appearance returns to the original state and the changes are lost.

 Private Sub FrmScheduler_Load(sender As Object, e As EventArgs) Handles Me.Load
        Me.ScheduleControl1.Appearance.AllDayBackColor = ColorTranslator.FromHtml(lightGreen)
        Me.ScheduleControl1.Appearance.WorkWeekHeaderBackColor = ColorTranslator.FromHtml(lightGreen)
        Me.ScheduleControl1.Appearance.TodayBackColor = ColorTranslator.FromHtml(darkGreen)
        Me.ScheduleControl1.Appearance.MoreItemArrowBorderColor = ColorTranslator.FromHtml(darkGreen)
        Me.ScheduleControl1.Appearance.NavigationCalendarHeaderColor = ColorTranslator.FromHtml(darkGreen)
        Me.ScheduleControl1.Appearance.NavigationCalendarTodayBackColor = ColorTranslator.FromHtml(darkGreen)
        Me.ScheduleControl1.Appearance.NavigationCalendarSelectionColor = ColorTranslator.FromHtml(softGreen)
    End Sub




What am I doing wrong? Thank you.
Fèlix

Attachment: VB_b1ada577.zip

1 Reply

MG Mohanraj Gunasekaran Syncfusion Team December 14, 2016 01:40 PM UTC

Hi Felix, 

Thanks for using Syncfusion products. 

As per the ScheduleControl architecture, the appearance styles will be reset to its default, when the schedule views have been changed dynamically. Moreover, the reported scenario can be achieved by handling the SetupContextMenu event. Please refer the following code snippet and refer the attached sample, 

Codesnippet 
AddHandler Me.scheduleControl1.SetupContextMenu, AddressOf scheduleControl1_SetupContextMenu 
 
Private Sub scheduleControl1_SetupContextMenu(ByVal sender As Object, ByVal e As CancelEventArgs) 
   Me.ApplyVisualStyle() 
End Sub 
 
Private Sub ApplyVisualStyle() 
    Me.scheduleControl1.Appearance.AllDayBackColor = Color.SaddleBrown 
    Me.scheduleControl1.Appearance.WorkWeekHeaderBackColor = Color.Red 
    Me.scheduleControl1.Appearance.TodayBackColor = Color.Yellow 
    Me.scheduleControl1.Appearance.NavigationCalendarBackColor = Color.Violet 
    Me.scheduleControl1.Appearance.NavigationCalendarTodayBackColor = Color.YellowGreen 
    Me.scheduleControl1.Appearance.NavigationCalendarSelectionColor = Color.Thistle 
End Sub 
 
Sample link: ScheduleControl 

Regards, 
Mohanraj G. 


Loader.
Up arrow icon