How to change the border color of a pushbutton in guide

7 visualizaciones (últimos 30 días)
Gopichandh Danala
Gopichandh Danala el 3 de Nov. de 2019
Comentada: Walter Roberson el 3 de Nov. de 2019
I am trying to see if I can add a color to the border of a pushbutton.
I checked some undocumented matlab and found this: link
jEdit = findjobj(handles.open) ; % handles.open -- pushbutton name - open
lineColor = java.awt.Color(1,0,0); % =red
thickness = 3; % pixels
roundedCorners = true;
newBorder = javax.swing.border.LineBorder(lineColor,thickness,roundedCorners);
jEdit.Border = newBorder;
jEdit.repaint; % redraw the modified control
This works for edit textbox but not for pushbutton.
I went through a similar question: Here. It shows that buttons border style is not affected after changing anything from default setting.
Any help is great.
  3 comentarios
Gopichandh Danala
Gopichandh Danala el 3 de Nov. de 2019
dropping the button to uipanel works using the 'ShadowColor '. Thanks.
But if I have to do this for all pushbuttons with a specific bordercolor it becomes more tedious.
Is this the only way for now?
Walter Roberson
Walter Roberson el 3 de Nov. de 2019
Perhaps you could hook in to DefaultUicontrolCreateFcn ?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by