Detect a textbox content has changed

8 次查看(过去 30 天)
Hi,
I’m trying to implement an "apply" bottom in a GUI, it function is to save the values of several textbox to variables used by another part of code. i want to disable the bottom when the user press it and enable it when the user modify the value of any textbox in the GUI. The problem is how to detect a change in the value of the objects to enable the bottom. Can anyone help me with suggestion on how to do this. Thanks in advance.

回答(1 个)

Jatin Nanda
Jatin Nanda 2016-7-27
编辑:Jatin Nanda 2016-7-27
Hey Diego!
It seems that you want your app to perform different operations as a response to UI events that occur. Luckily, performing an action as a response to a change is the exact role of a call back function that can be attached to various UI components.
In MATLAB App Designer, you will notice that each component you drag onto the UIFigure will have properties shown on the bottom right of your screen. If you click on the 'CallBacks' tab, you will be able to enter a name for a custom callback function for each component. In your case, you would need to do this for each EditText/Button object that you would like to monitor for changes.
Once complete, you should be taken to the code-view of the application where you can write the implementation of the function you have just named. This is where you would save variables, disable buttons, or modify text as you see fit.
To see a full list of the operations you can perform on various components, check out the documentation: http://www.mathworks.com/help/matlab/components-in-app-designer.html
Hope that helps!
  1 个评论
Jatin Nanda
Jatin Nanda 2016-7-28
If you're not dealing with MATLAB App Designer, you can accomplish this call back function setting programatically through the uicontrol method in MATLAB. http://www.mathworks.com/help/matlab/ref/uicontrol.html

请先登录,再进行评论。

类别

Help CenterFile 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!

Translated by