The SftMask.HitTest method returns the part of the control at a location in client coordinates, for example to show a tooltip or a context menu of the application's own:
| Value | Description |
|---|---|
| HitAreaEnum.Edit | The input area. |
| HitAreaEnum.Label | The label. |
| HitAreaEnum.UpButton | The up button. |
| HitAreaEnum.DownButton | The down button. |
| HitAreaEnum.EllipseButton | The ellipse button. |
| HitAreaEnum.None | Outside the control's parts, such as the border. |
The SftMask.GetCharIndexFromPosition method returns the boundary between positions closest to a location, from 0 to the number of positions; the SftMask.GetPositionFromCharIndex method returns the location of a position, and the SftMask.GetCharBounds method the rectangle covering a range of positions.
C#
private void sftMask1_MouseMove(object sender, MouseEventArgs e) {
if (sftMask1.HitTest(e.Location) == HitAreaEnum.Label)
toolTip1.SetToolTip(sftMask1, "Amounts are in US dollars");
else
toolTip1.SetToolTip(sftMask1, null);
}VB
Private Sub SftMask1_MouseMove(sender As Object, e As MouseEventArgs) Handles SftMask1.MouseMove
If SftMask1.HitTest(e.Location) = HitAreaEnum.Label Then
ToolTip1.SetToolTip(SftMask1, "Amounts are in US dollars")
Else
ToolTip1.SetToolTip(SftMask1, Nothing)
End If
End Sub