Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
UltraDayView: Current Time, Element above the appointment
posted

Hello Everyone, 

I am trying to manually create a timeline that shows the current time on an ultra day view, i have used the code below to alter the timeslotuielement to show a red line. It works great except it is always behind the appointment, any ideas on how to get it to always be infront?

Dim timeElement As TimeSlotUIElement = DirectCast(drawParams.Element, TimeSlotUIElement)

Dim timeSlot As TimeSlot = CType(timeElement.GetContext(GetType(TimeSlot), True), TimeSlot)
Dim calInfo As UltraCalendarInfo = timeSlot.DayView.CalendarInfo

If dt > Now.AddMinutes(-increment) And dt < Now Then

Dim diffMin As Integer = (Now.Minute - dt.Minute) * integers
drawParams.AppearanceData.ForeColor = Color.Red

Dim colorSlot As ImageUIElement = New ImageUIElement(timeElement, My.Resources.red)
colorSlot.Rect = New System.Drawing.Rectangle(timeElement.Rect.X, timeElement.Rect.Y + (diffMin), timeElement.Rect.Width, 1.5)
timeElement.ChildElements.Add(colorSlot)

End If