what is the best way to increase font size of Prompt window?

64 Ansichten (letzte 30 Tage)
Msutto51
Msutto51 am 6 Apr. 2017
Bearbeitet: Adam Danz am 25 Jun. 2019
I'm using this function for a pop up window for users to enter text.
"prompt = {'Enter Serial Number:'}; Title = 'Attention!'; defaultans = {''}; x = inputdlg(prompt,Title,[1 35]);"
What is the best way to increase font size of the Title/Prompt text? I also would like to change pop window color and size.

Antworten (2)

Image Analyst
Image Analyst am 6 Apr. 2017
They've known about the lame capabilities of msgbox(), questdlg(), warndlg(), errordlg(), inputdlg() for ages and they've never chosen to enhance them so I guess they just don't want to, despite being a pain to the users for decades. I know other functions like title(), text(), xlabel(), etc. have options like 'FontSize', 'FontWeight', 'ForegroundColor', etc. but for some reason unknown to me they don't seem to want to offer those options to dialog boxes that ask for user input.
If you start GUIDE, one of the options is a custom dialog box where you have complete control over all of that, so I guess that's how they want you to do it. I know it seems like an overly complicated way to do a simple dialog box, but that seems to be what they want us to do. Grrrrrr.
  2 Kommentare
Msutto51
Msutto51 am 6 Apr. 2017
The msgbox() was straight forward and easy, Well looks like I'll have to try the GUIDE!!! Thanks for the feedback.
Adam Danz
Adam Danz am 10 Aug. 2018
Bearbeitet: Adam Danz am 25 Jun. 2019
In case others were looking for a solution, here's a function that receives the msgbox handle and a fontsize. I got tired of squinting. You can also set any other text property.

Melden Sie sich an, um zu kommentieren.


Tomonori Mizoe
Tomonori Mizoe am 16 Sep. 2018
Bearbeitet: Tomonori Mizoe am 16 Sep. 2018
How about this?
prompt = {'\fontsize{15} Enter Serial Number:'};
Title = 'Attention!';
defaultans = {''};
opts.Interpreter = 'tex';
x = inputdlg(prompt,Title,[1 35], defaultans, opts);
You can specify the font size of the text in the input dialog with TeX syntax.
  1 Kommentar
Saul Stokar
Saul Stokar am 25 Jun. 2019
Kudos on your answer. However, it only increases the font of the prompts, not the defaults or the buttons.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by