Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change the default action of a button that is defined with basicButtonStyle

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Change the default action of a button that is defined with basicButtonStyle

    I have created a button on the chart -- the behavior that I am looking for is the button background is Green.

    When I click AND HOLD on the button and am hovered over it - I want the background to turn to dark green. BUT I am still holding the mouse down. I can move the cursor off the button and I want the background to remain dark green. however if I release off of the button it returns back to green color.

    The behavior I am seeing is that when I click and hold over the button the background changes to a grey color - but when I move the cursor off the button the background goes to dark green, but when I again hover over the button it goes back to grey.


    #2
    Hello WHICKED,

    Thank you for your post.

    The behavior you are seeing is because once you move the cursor off of the button, the mouse is no longer interacting with the button so it is not being pressed unless the cursor is on top of the button. What you could try is using the MouseDown event. You can check what the focused object is using Mouse.DirectlyOver which will give you the UI element under the cursor. If it is the button, you can change the background color of the button to dark green. You can also check the MouseMove event and when the button is no longer the object in focus you could still change the background color to dark green. Here are some relevant publicly available links:
    There is some discussion about a button hold event command at the following publicly available link that may also be helpful to achieve what you are looking for:
    I want to be able to assign two different Command to a Button: Click event Command Hold event Command which uses HoldTimeout property to specify the hold duration public static readonly


    Please let us know if we may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    646 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    367 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    570 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X