EnableToolTips Method
Description
Enables or disables the use of standard tool tips in the calendar control.
Syntax
Public Sub EnableToolTips( _
ByVal Enable As Boolean _
)
Parameters
- Enable
True to enable standard tool tips.
False to disable standard tool tips.
Remarks
Standard tool tips are displayed automatically when the mouse cursor is hovering over an event that is too small to display the entire subject for the event. A standard tool tip is a small pop-up window that displays a single line of text describing the hidden text when hovering over an event in the calendar view.
Custom tool tips can also be displayed using the ToolTipText property (this property is inherited, so it is not listed in the help). The ToolTipText property can be used in events such as MouseMove to display a custom event based on when the mouse cursor is hovering over. Tool tips do not have to be enabled to display custom tool tips. This way, the standard tool tip can be hidden while still displaying custom tool tips. When using custom tool tips, the ToolTipText property will always contain the text to display as a tool tip.
Example
Custom Tool Tip Sample (Visual Basic)
This sample illustrates how to display a custom tool tip for events while the mouse cursor is positioned over an event.
Private Sub CalendarControl_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim HitTest As CalendarHitTestInfo
Set HitTest = CalendarControl.ActiveView.HitTest
If (Not HitTest.ViewEvent Is Nothing) Then
Debug.Print "MouseMove. HitTest = "; HitTest.ViewEvent.Event.Subject
' Display the event Id and Subject as a custom tool tip when the mouse is over an event
CalendarControl.ToolTipText = "[" & HitTest.ViewEvent.Event.Id & "] " & HitTest.ViewEvent.Event.Subject
Else
CalendarControl.ToolTipText = ""
End If
End Sub
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.