/
Form1.vb
45 lines (39 loc) · 1.78 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
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports DevExpress.XtraScheduler
Namespace AptTooltipDrag
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub schedulerControl1_AppointmentDrag(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.AppointmentDragEventArgs) Handles schedulerControl1.AppointmentDrag
If e.HitInterval.Start.TimeOfDay.Hours <= 9 Then
Me.toolTipController1.ShowHint("You cannot move appointment to this area")
Application.DoEvents()
Else
Me.toolTipController1.HideHint()
End If
End Sub
Private Sub schedulerControl1_AppointmentDrop(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.AppointmentDragEventArgs) Handles schedulerControl1.AppointmentDrop
If e.HitInterval.Start.TimeOfDay.Hours <= 9 Then
Me.toolTipController1.ShowHint("Operation is cancelled")
e.Allow = False
End If
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Dim apt As Appointment = Me.schedulerStorage1.CreateAppointment(AppointmentType.Normal)
apt.Start = Date.Now.Date.AddHours(12)
apt.Subject = "Sample Appointment"
Me.schedulerStorage1.Appointments.Add(apt)
Me.schedulerControl1.ActiveViewType = SchedulerViewType.Day
Me.schedulerControl1.Start = Date.Now.Date
Me.schedulerControl1.DayView.TopRowTime = New TimeSpan(8, 0, 0)
End Sub
End Class
End Namespace