MATLAB Answers

How to reset default values by button press in GUI?

71 ビュー (過去 30 日間)
Nimra Azmat
Nimra Azmat 2019 年 6 月 30 日
編集済み: Shameer Parmar 2019 年 7 月 1 日
How can i get the default or initial values of the silder and edit box on pressing the Reset All button
ma.JPG
  2 件のコメント
Jan
Jan 2019 年 6 月 30 日
What have you tried so far? With GUIDE or AppDesigner it should be more or less trivial to set the values of objects in a callback. So please post, what you have tried so far and which problem you have.

サインインしてコメントする。

回答 (1 件)

Shameer Parmar
Shameer Parmar 2019 年 7 月 1 日
編集済み: Shameer Parmar 2019 年 7 月 1 日
Hello Nimra,
Open your .m file and go to callback of pushbutton 'ResetAll'
then mention the following commands..
set(handles.slider1,'Value',0);
% Here instead of '0' you can put your default value.
set(handles.edit1,'string','');
% Here instead of '' you can put your default string.
Please check if this works for you or you need any more help..

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by