How to position and resize the list box window?

26 ビュー (過去 30 日間)
David Mrozek
David Mrozek 2021 年 3 月 6 日
コメント済み: Mario Malic 2021 年 3 月 6 日
Hello everyone,
I have the following code:
list = {...
['Start the dataimport (with a total of' num2str(height(Datapoint)) 'datapoints']...
,'rerun the script'...
};
[indx] = listdlg('SelectionMode','single','ListString',list);
if indx == 1
%do some stuff
end
if indx == 2
%rerun script
end
where the variable Datapoint represents the amount of datapoints (245256 x 1) double.
I would like to inform the user about the datapoints that were generated through the script. However the window size looks squeezed and therefore hinders the correct reading of the full sentence. How can I:
a.) Resize the list box window. I am familiar with the Position[0.2 0.2 0.2 0.2] command but I have no idea where to implement it correctly
b.) reposition the window freely, not through the commands left right bottom or top
How could I achieve this desired options?

採用された回答

Mario Malic
Mario Malic 2021 年 3 月 6 日
Hi David,
a) ListSize property does what you would like to do. These numbers are actually pixels
listdlg('SelectionMode','single','ListString',list, 'ListSize', [150 300])
If this window is shown in different screen resolutions, consider setting it as relative measure through
get(groot, 'ScreenSize')
I don't understand your b question.
  2 件のコメント
David Mrozek
David Mrozek 2021 年 3 月 6 日
to b.) I wanted to freely decide where I can position the list box on my screen
Mario Malic
Mario Malic 2021 年 3 月 6 日
As far as I know, I don't think it's possible to place it somewhere else other than middle of your screen.
If you really need it, use uilistbox on a uifigure object.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by