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
175
Drag and drop highligth appointment
posted

Hi,

     we are implementing drag and drop from another control to an UltraDayView and we want to highlight the appointment(change bordercolor for example)  that is below the cursor when the user is doing the drag and dropping.

    Any ideas for implementing this feature?

Thanks,

Parents
No Data
Reply
  • 175
    Verified Answer
    Offline posted

    Hi,

    finally we found a solution. We implement it with this events:

    Private lastApp As Appointment

       Private Sub UltraDayView1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles UltraDayView1.DragDrop

            Dim _IdPet As Guid = e.Data.GetData(GetType(Guid))
            If _IdPet <> Guid.Empty Then
                MsgBox(_IdPet.ToString)
            End If

            If lastApp IsNot Nothing Then
                lastApp.Appearance.ResetBorderColor()
            End If

        End Sub

        Private Sub UltraDayView1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles UltraDayView1.DragEnter

            e.Effect = DragDropEffects.Copy

        End Sub

        Private Sub UltraDayView1_DragLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles UltraDayView1.DragLeave

            If lastApp IsNot Nothing Then
                lastApp.Appearance.ResetBorderColor()
            End If

        End Sub

        Private Sub UltraDayView1_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles UltraDayView1.DragOver

            If lastApp IsNot Nothing Then
                lastApp.Appearance.ResetBorderColor()
            End If

            Dim app As Appointment = Nothing
            app = UltraDayView1.GetAppointmentFromPoint(UltraDayView1.PointToClient(New Point(e.X, e.Y)))
            If app IsNot Nothing Then
                app.Appearance.BorderColor = Color.Red
            End If
            lastApp = app

        End Sub

     

     

     

Children