Type | Description | |||
X as OLE_XPOS_PIXELS | A single that specifies the current X location of the mouse pointer. The x values is always expressed in client coordinates. | |||
Y as OLE_YPOS_PIXELS | A single that specifies the current X location of the mouse pointer. The x values is always expressed in client coordinates. | |||
Highlight as Boolean | A Boolean expression that indicates whether the word from the position is highlighted. | |||
Reserved as Variant | A long expression that specifies the part/parts of the control to search for the word from the cursor. | |||
String | A String expression that indicates the word from the cursor. |
The following VB sample displays the word from the cursor:
Private Sub G2antt1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Debug.Print G2antt1.WordFromPoint(-1, -1) End Sub
The following VB sample highlights the word from the cursor, as soon as the cursor hovers a word:
Private Sub G2antt1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Debug.Print G2antt1.WordFromPoint(-1, -1, True) End Sub
The following screen shot shows the "Team" word being highlighted when the cursor hovers it:
As soon as the cursor hovers another word it gets highlighted. The highlighting is temporary so as soon as the control is repainted the highlight is lost. For instance, you resize a column, scroll, or select a new item.
The following VB sample highlight the word from the cursor, and displays a context menu ( eXPopupMenu ) when the user right clicks the control:
Private Sub G2antt1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Debug.Print G2antt1.WordFromPoint(-1, -1, True) End Sub Private Sub G2antt1_RClick() Dim i As Long With PopupMenu1.Items .Clear .Add G2antt1.WordFromPoint(-1, -1, True) End With i = PopupMenu1.ShowAtCursor() End Sub
Currently, the Reserved parameter could be a combination ( bitwise OR ) of any of the following:
(1) - Items area ( the area where the items are shown )
(2) - Header area ( the area where the column's caption is displayed )
(4) - SortBar area ( the part of the control that shows the sorting columns, if multiple columns sorting is enabled )
(8) - FilterBar area ( the part of the control that displays the filter bar )
(256) - Histogram area ( the part of the control that displays the chart's histogram )
For instance, if the Reserved parameter is 1 + 2 (3), the WordFromPoint property retrieves the word from Items or Header area as well. If missing the control looks for the word in the Items section.