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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change the mouse cursor to hand while 'HotTracking'

Thread ID:

Created:

Updated:

Platform:

Replies:

132626 Sep 12,2017 07:56 PM UTC Sep 14,2017 04:00 AM UTC WinForms 3
loading
Tags: TabControlAdv
Manuel Estevez
Asked On September 12, 2017 07:56 PM UTC

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();
        }



Durga Rajan [Syncfusion]
Replied On 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. 


Manuel Estevez
Replied On September 13, 2017 08:19 AM UTC

Just that I was looking for!

Thanks!


Durga Rajan [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;