필터 지우기
필터 지우기

Change backround colour of pushbutton to black in GUI

조회 수: 2 (최근 30일)
Gry
Gry 2014년 11월 9일
답변: Gry 2014년 11월 12일
Hi!
I have created a GUI with a piano in matlab. My problem is I want the colour of the pushbuttons at top to be black to make it look more like a Piano, but I'm only able to change the frame colour not the backround colour.

답변 (3개)

Jan
Jan 2014년 11월 9일
What is the "frame color"? You can set the 'backgorundcolor' of buttons. And when I open your FIG file, the buttons are black.
Are you running this on a Mac, where the button colors are controlled by the operating system?
  댓글 수: 1
Gry
Gry 2014년 11월 10일
Yes I'm using a Macbook air! When I open the figure only the frame of the button is black Will try to open my m.file on a W7

댓글을 달려면 로그인하십시오.


matt dash
matt dash 2014년 11월 10일
Instead of setting the BackgroundColor property, you can use the CData property to superimpose an image onto your button. (This at least worked on Macs several years ago, i haven't tried it recently) If you can draw the button you want, e.g. in photoshop, you can then import it to use on your button.
As a test, try setting the CData property to zeros(m,n,3) where m and n are the width and height of your button in pixels.
  댓글 수: 1
Gry
Gry 2014년 11월 11일
What if you only want the colour of a pushbutton to change temporarily when you click it. Then go back to normal colour once you click another button?

댓글을 달려면 로그인하십시오.


Gry
Gry 2014년 11월 12일
What if you only want the colour of a pushbutton to change temporarily when you click it. Then go back to normal colour once you click another button while the colour of the next pushbutton you click change?

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by