scroll bar does not work when dialog box appears in app designer

11 次查看(过去 30 天)
I am attaching the code, which is used to read the text files from the directory. whenever the dialog box appears the scroll bar as shown in the image freezes, is there any way i can scroll the text file names along with the dialog box open. Image and code attached.
properties (Access = private)
txt_files
txt_DIR
txt_file_bas
end
methods (Access = private)
% Button pushed function: UploadFilesButton
function UploadFilesButtonPushed(app, event)
app.txt_DIR = 'C:\Users\Windows 10\Documents\samples\';
app.txt_files = dir([app.txt_DIR '*.txt']);
b={app.txt_files(:).name}';
app.TextArea.Value=app.txt_DIR ; % Sets the label text to be the selected path
b(ismember(b,{'.','..'})) = []; % Removes unnecessary '.' and '..' results from the display.
for txt_i = 1:length(app.txt_files)
s_no{txt_i}=(txt_i);
end
s_no=s_no';
app.UITable.Data=[s_no b]; % Displays the directory information to the UITable.
txt = inputdlg('Enter text value',...
'Enter text value', [1 50]);
end
% Value changed function: TextArea
function TextAreaValueChanged(app, event)
value = app.TextArea.Value;
end
end

采纳的回答

Voss
Voss 2022-4-18
inputdlg creates a modal dialog box. "Modal" means that no other window can be interacted with while the modal window is up.
To allow interacting with other windows while the inputdlg window is up, you can make the inputdlg non-modal:
txt = inputdlg( ...
'Enter text value', ... % prompt
'Enter text value', ... % title
[1 50], ... % dimensions of edit field
{''}, ... % default answer
struct('WindowStyle','normal')); % options

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by