声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1062|回复: 3

[GUI界面] 如何使用Button 控制事件

[复制链接]
发表于 2007-4-26 17:07 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
我是matlab新手,用的6.5版本,想学习下  button 的使用方法,
比如我想通过GUI程序实现下面这个功能:
    edit  text1                  edit  text2


    button1                       button2


当按下 button1时, text1中的内容可以覆盖text2内容显示出来
同样按下button2时,text2中的内容可以在text1中显示出来

请问应该用什么函数来控制 button 呢?
回复
分享到:

使用道具 举报

发表于 2007-4-26 17:25 | 显示全部楼层
原帖由 spano 于 2007-4-26 17:07 发表
我是matlab新手,用的6.5版本,想学习下  button 的使用方法,
比如我想通过GUI程序实现下面这个功能:
    edit  text1                  edit  text2


    button1                       button2


...

建议看看本版关于GUI的精华贴
 楼主| 发表于 2007-4-26 21:39 | 显示全部楼层

回复 #1 spano 的帖子

谢谢,我得程序基本可以实现这个功能了;
想问下在button 里面 callback 函数和 ButtonDownFcn的具体区别有哪些
发表于 2007-4-26 22:02 | 显示全部楼层
原帖由 spano 于 2007-4-26 21:39 发表
谢谢,我得程序基本可以实现这个功能了;
想问下在button 里面 callback 函数和 ButtonDownFcn的具体区别有哪些


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)


% --- If Enable == 'on', executes on mouse press in 5 pixel border.
% --- Otherwise, executes on mouse press in 5 pixel border or over pushbutton1.
function pushbutton1_ButtonDownFcn(hObject, eventdata, handles)
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-24 15:26 , Processed in 0.053650 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表