Forum Discussion

vladd1's avatar
vladd1
New Contributor
4 months ago
Solved

Need to verify cursor state on disabled button

Thank you for whoever helps to start, The issue I am seeing is running a disabled check on a button in my application. Unfortunately our team believes the best way to check the code we have to work ...
  • scot1967's avatar
    4 months ago

    Hello vladd1,

    I think I know what you are struggling with. 

    You may have this doc which explains settings the various cursor states....
    https://support.smartbear.com/testcomplete/docs/reference/user-forms/properties/cursor.html

    The button likely has a .cursor property however.

    var form = UserForms.SampleForm;
    var button = form.buttonOK;
    
    // Moves the cursor to the button center
    button.MouseMove();
    
    //Returns the cursor type
    var currentCursor = button.Cursor;
    Log.Message("Cursor type: " + currentCursor);

    This code reads the current cursor type and logs it. The value returned will be one of the cr* constants (like crDefault, crHandPoint, etc.).

    ... If you find my posts helpful drop me a like! šŸ‘ Be sure to mark or post the solution to help others out and/or to credit the one who helped you. šŸ˜Ž