编辑框的使用

[复制链接]
350|0
 楼主| cooldog123pp 发表于 2023-12-30 20:11 | 显示全部楼层 |阅读模式
h0=figure('toolbar','none',...
    'position',[200 150 350 250],...
    'name','实例35');
f='Please input the letter';
huidiao1=[...
        'g=upper(f);,',...
        'set(h2_edit,''string'',g),',...
    ];
huidiao2=[...
        'g=lower(f);,',...
        'set(h2_edit,''string'',g),',...
    ];
h1_edit=uicontrol(gcf,'style','edit',...
    'position',[100 200 100 50],...
    'HorizontalAlignment','left',...
    'string','Please input the letter',...
    'callback','f=get(h1_edit,''string'');',...
    'background','w',...
    'max',5,...
    'min',1);
h2_edit=uicontrol(gcf,'style','edit',...
    'HorizontalAlignment','left',...
    'position',[100 100 100 50],...
    'background','w',...
    'max',5,...
    'min',1);
h1_button=uicontrol(gcf,'style','pushbutton',...
    'string','小写变大写',...
    'position',[100 45 100 20],...
    'callback',huidiao1);
h2_button=uicontrol(gcf,'style','pushbutton',...
    'string','大写变小写',...
    'position',[100 20 100 20],...
    'callback',huidiao2);

您需要登录后才可以回帖 登录 | 注册

本版积分规则

2304

主题

7631

帖子

31

粉丝
快速回复 在线客服 返回列表 返回顶部