We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Change the mouse cursor to hand while 'HotTracking'

Hi,

I would like to change the mouse cursor from default (arrow) to hand while in 'HotTracking' over tab pages selector. I found in the KB how to change the colors, font, etc, and tried to change also de cursor, but it does'nt work. Is there a way to do?

Thanks in advance

Sample code:

TabCtrl.DrawItem += TabCtrl_DrawItem;
private void TabCtrl_DrawItem(object sender, DrawTabEventArgs drawItemInfo) {
            if ((drawItemInfo.State & DrawItemState.HotLight) > 0) {
                Cursor.Current = Cursors.Hand;
            }
            drawItemInfo.DrawBackground();
            drawItemInfo.DrawInterior();
        }



3 Replies

DR Durga Rajan Syncfusion Team September 13, 2017 06:31 AM UTC

Hi Manuel 

Thanks for contacting Syncfusion Support.   
  
We have checked your query and prepared a sample to meet your requirement. In this sample, we have changed the cursor type as hand in Mouse move event of TabControlAdv and restore the cursor type as default in Mouse leave event of TabControlAdv. Please download the sample for the same from below location,   


Code Example: 

        private void TabControlAdv1_MouseMove(object sender, MouseEventArgs e) 
        { 
            for (int i = 0; i < this.tabControlAdv1.TabCount; i++) 
            { 
                if (this.tabControlAdv1.GetTabRect(i).Contains(e.Location)) 
                { 
                    this.tabControlAdv1.Cursor = Cursors.Hand; 
                    break; 
                } 
                else 
                { 
                    this.tabControlAdv1.Cursor = Cursors.Default; 
                } 
            }            
        } 
 
        private void TabControlAdv1_MouseLeave(object sender, EventArgs e) 
        { 
            this.tabControlAdv1.Cursor = Cursors.Default; 
        } 


If we misunderstood your query please provide more details about your requirement. This would help us to provide solution at earliest. 

Regards, 
Durga S. 



ME Manuel Estevez September 13, 2017 08:19 AM UTC

Just that I was looking for!

Thanks!



DR Durga Rajan Syncfusion Team September 14, 2017 04:00 AM UTC

Hi  Manuel,  

We are glad to know that your issue has been solved. Please let us know if you need any further assistance. 

Regards, 
Durga S. 


Loader.
Live Chat Icon For mobile
Up arrow icon