在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
Dialog对话框 语法: h = dialog('PropertyName',PropertyValue,...) 对话框的默认属性
WindowStyle的值: {normal} | modal | docked 详细实例: out = dialog; %默认显示对话框之后点击对话框中的空白部分对话框会关闭掉 结果:
%普通对话框 out = dialog('WindowStyle', 'normal',... 'Name', '我的Dialog对话框',... 'position',[300 300 400 300]); uicontrol('parent',out,... 'style','pushbutton',... 'position',[80 40 80 50],... 'string','确定',... 'callback','delete(gcbf)');%回调函数,点击button关闭对话框 结果:(点击button关闭对话框)
错误对话框errordlg 语法: h = errordlg h = errordlg(errorstring) h = errordlg(errorstring,dlgname) h = errordlg(errorstring,dlgname,createmode) %createmode取值:non-modal (默认),modal,replace 举例: h = errordlg('对话框内容','对话框标题','modal')
warndlg警告对话框(跟错误对话框类似) 语法: h = warndlg h = warndlg(warningstring) h = warndlg(warningstring,dlgname) h = warndlg(warningstring,dlgname,createmode) 举例: warndlg('Pressing OK will clear memory','!! Warning !!') 结果: |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论