How to disable click effect of a button in App designer
조회 수: 6 (최근 30일)
이전 댓글 표시
When I place a button in App desiner, the button looks like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1661716/image.png)
But when I click the button, there seems to be a clicked effect on the button (the blue color around the button):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1661721/image.png)
May I ask if there a way to disable this clicked effect with a code or setting, so that whenever I clicked, the button just stay gray like the first image? Thanks very much if anyone can help me :D
댓글 수: 0
답변 (1개)
Poorna
2024년 4월 6일
Hi Victor,
I see that the "uibutton" that you are using is continued in a clicked state after you press the button. I believe the reason for this could be that you might be setting the style property of the button to "state" instead of "push". An uibutton created with style property set to "state" will continue to retain its clicked state even after releasing the click of the mouse. While a uibutton created with the style property set to "push" will return back to its normal state after the click is released. You could create a uibutton of style "push" as below:
fig = uifigure;
b = uibutton(fig);
To know more about the uibutton and it's "style" property refer to the following documentation:
Hope this Helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!