Ejemplo n.º 1
0
        // show hyperlink cursor
        private void _flex_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            HitTestInfo ht   = _flex.HitTest(e.X, e.Y);
            bool        hand = false;

            if (ht.Type == HitTestTypeEnum.Cell)
            {
                Hyperlink link = _flex[ht.Row, ht.Column] as Hyperlink;
                if (link != null)
                {
                    using (Graphics g = _flex.CreateGraphics())
                    {
                        Rectangle rc    = _flex.GetCellRect(ht.Row, ht.Column, false);
                        int       width = (int)g.MeasureString(link.ToString(), _flex.Font).Width;
                        if (e.X - rc.Left <= width)
                        {
                            hand = true;
                        }
                    }
                }
            }
            Cursor = (hand)? Cursors.Hand: Cursors.Default;
        }