private int HitTest(Point point)
{
NativeMethods.POINT pt = new NativeMethods.POINT();
pt.x = point.X;
pt.y = point.Y;
int hit = NativeMethods.SendMessage(Handle, NativeMethods.TB_HITTEST, 0, ref pt);
if (hit > 0)
{
point = this.PointToScreen(point);
Rectangle bounds = this.RectangleToScreen(new Rectangle(0, 0, Width, Height));
if (!bounds.Contains(point))
{
return -1;
}
}
return hit;
}