-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.vb
68 lines (62 loc) · 2.58 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
' Developer Express Code Central Example:
' How to hide weekends in the Timeline view
'
' This example illustrates the use of a custom scale to hide the weekends in the
' Timeline view. The Saturday and Sunday are considered weekend. The Friday column
' actually contains three days - Friday, Saturday and Sunday. So it is painted
' with the color specified for the non-working days. To correct this, the
' CustomDrawTimeCell event can be handled and the time cell can be painted
' manually. The Paint Correction check box is used for switching the event
' handling on and off.
'
' You can find sample updates and versions for different programming languages here:
' http://www.devexpress.com/example=E1214
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraScheduler
Imports DevExpress.XtraEditors
Imports DevExpress.XtraScheduler.Drawing
Imports System.Drawing
Namespace TimelineTimeScales
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
schedulerControl1.OptionsView.FirstDayOfWeek = FirstDayOfWeek.Monday
HideWeekends(False)
End Sub
Private Sub schedulerControl1_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs)
Text = "Selected interval: " & schedulerControl1.SelectedInterval.ToString()
End Sub
Private Sub checkEdit1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim editor As CheckEdit = TryCast(sender, CheckEdit)
HideWeekends(editor.Checked)
End Sub
Private Sub HideWeekends(ByVal hide As Boolean)
Dim scales As TimeScaleCollection = schedulerControl1.TimelineView.Scales
If hide Then
scales.BeginUpdate()
Try
scales.Clear()
scales.Add(New TimeScaleMonth())
Dim customWorkWeekScale As TimeScaleWorkWeekDay = New TimeScaleWorkWeekDay()
customWorkWeekScale.Width = 125
scales.Add(customWorkWeekScale)
Finally
scales.EndUpdate()
End Try
Else
scales.BeginUpdate()
Try
scales.Clear()
scales.Add(New TimeScaleMonth())
Dim dayScale As TimeScaleDay = New TimeScaleDay()
dayScale.Width = 125
scales.Add(dayScale)
Finally
scales.EndUpdate()
End Try
End If
End Sub
End Class
End Namespace