GUI界面相应事件

  1 function varargout = GUI19(varargin)
  2 % GUI19 MATLAB code for GUI19.fig
  3 %      GUI19, by itself, creates a new GUI19 or raises the existing
  4 %      singleton*.
  5 %
  6 %      H = GUI19 returns the handle to a new GUI19 or the handle to
  7 %      the existing singleton*.
  8 %
  9 %      GUI19('CALLBACK',hObject,eventData,handles,...) calls the local
 10 %      function named CALLBACK in GUI19.M with the given input arguments.
 11 %
 12 %      GUI19('Property','Value',...) creates a new GUI19 or raises the
 13 %      existing singleton*.  Starting from the left, property value pairs are
 14 %      applied to the GUI before GUI19_OpeningFcn gets called.  An
 15 %      unrecognized property name or invalid value makes property application
 16 %      stop.  All inputs are passed to GUI19_OpeningFcn via varargin.
 17 %
 18 %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
 19 %      instance to run (singleton)".
 20 %
 21 % See also: GUIDE, GUIDATA, GUIHANDLES
 22 
 23 % Edit the above text to modify the response to help GUI19
 24 
 25 % Last Modified by GUIDE v2.5 24-Jan-2018 09:38:12
 26 
 27 % Begin initialization code - DO NOT EDIT
 28 gui_Singleton = 1;
 29 gui_State = struct('gui_Name',       mfilename, ...
 30                    'gui_Singleton',  gui_Singleton, ...
 31                    'gui_OpeningFcn', @GUI19_OpeningFcn, ...
 32                    'gui_OutputFcn',  @GUI19_OutputFcn, ...
 33                    'gui_LayoutFcn',  [] , ...
 34                    'gui_Callback',   []);
 35 if nargin && ischar(varargin{1})
 36     gui_State.gui_Callback = str2func(varargin{1});
 37 end
 38 
 39 if nargout
 40     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
 41 else
 42     gui_mainfcn(gui_State, varargin{:});
 43 end
 44 % End initialization code - DO NOT EDIT
 45 
 46 
 47 % --- Executes just before GUI19 is made visible.
 48 function GUI19_OpeningFcn(hObject, eventdata, handles, varargin)
 49 % This function has no output args, see OutputFcn.
 50 % hObject    handle to figure
 51 % eventdata  reserved - to be defined in a future version of MATLAB
 52 % handles    structure with handles and user data (see GUIDATA)
 53 % varargin   command line arguments to GUI19 (see VARARGIN)
 54 
 55 % Choose default command line output for GUI19
 56 handles.output = hObject;
 57 
 58 % Update handles structure
 59 guidata(hObject, handles);
 60 
 61 % UIWAIT makes GUI19 wait for user response (see UIRESUME)
 62 % uiwait(handles.figure1);
 63 
 64 
 65 % --- Outputs from this function are returned to the command line.
 66 function varargout = GUI19_OutputFcn(hObject, eventdata, handles) 
 67 % varargout  cell array for returning output args (see VARARGOUT);
 68 % hObject    handle to figure
 69 % eventdata  reserved - to be defined in a future version of MATLAB
 70 % handles    structure with handles and user data (see GUIDATA)
 71 
 72 % Get default command line output from handles structure
 73 varargout{1} = handles.output;
 74 
 75 
 76 % --- Executes on button press in name.
 77 function name_Callback(hObject, eventdata, handles)
 78 % hObject    handle to name (see GCBO)
 79 % eventdata  reserved - to be defined in a future version of MATLAB
 80 % handles    structure with handles and user data (see GUIDATA)
 81 
 82 
 83 % --- Executes during object creation, after setting all properties.
 84 function name_CreateFcn(hObject, eventdata, handles)
 85 % hObject    handle to name (see GCBO)
 86 % eventdata  reserved - to be defined in a future version of MATLAB
 87 % handles    empty - handles not created until after all CreateFcns called
 88 
 89 
 90 
 91 function code_Callback(hObject, eventdata, handles)
 92 % hObject    handle to code (see GCBO)
 93 % eventdata  reserved - to be defined in a future version of MATLAB
 94 % handles    structure with handles and user data (see GUIDATA)
 95 
 96 % Hints: get(hObject,'String') returns contents of code as text
 97 %        str2double(get(hObject,'String')) returns contents of code as a double
 98 
 99 
100 % --- Executes during object creation, after setting all properties.
101 function code_CreateFcn(hObject, eventdata, handles)
102 % hObject    handle to code (see GCBO)
103 % eventdata  reserved - to be defined in a future version of MATLAB
104 % handles    empty - handles not created until after all CreateFcns called
105 
106 % Hint: edit controls usually have a white background on Windows.
107 %       See ISPC and COMPUTER.
108 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
109     set(hObject,'BackgroundColor','white');
110 end
111 
112 
113 % --- Executes on button press in load.
114 function load_Callback(hObject, eventdata, handles)
115 % hObject    handle to load (see GCBO)
116 % eventdata  reserved - to be defined in a future version of MATLAB
117 % handles    structure with handles and user data (see GUIDATA)
118 
119 name = get(handles.name, 'String' );
120 code = get(handles.code, 'String' );
121 
122 if strcmp(name, 'hehe') && strcmp(code, '123456')
123     delete(hObject);
124     GUI18;
125 end
View Code

转载于:https://www.cnblogs.com/shixinzei/p/8340097.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值