Jump to content
alogrep

custom fonts and sizes showmessage()

Recommended Posts

HI.

Is it possible to change font and button sizes in the showmessage() function? (Delphi 11.2)

Share this post


Link to post

Why not create your own ShowMessage function? After all it is simply a modal form that you can easily build yourself to fit your needs.

  • Like 2

Share this post


Link to post
3 hours ago, FPiette said:

Why not create your own ShowMessage function? After all it is simply a modal form that you can easily build yourself to fit your needs.

Of course there are several reasons why one would prefer to use ShowMessage:

  • It's a standard dialog form so the user will recognise it immediately and know how to use it
  • If the user skins his Windows installation, the dialog will automatically be skinned too
  • If the way Windows shows these dialogs changes, your own dialog will automatically change too

Changing the standard ShowMessage dialog in any way (different font etc.) will negate these advantages. The same applies to building a custom form.

 

Having said that: I too have created a dialog that replaces ShowMessage. The main reason was that I wanted to center that dialog on the parent form (or at least the main form) rather than the current monitor. (If anybody is interested: It's in w_dzDialog, which is part of my dzlib.)

Edited by dummzeuch

Share this post


Link to post

HI dummzeuch.

"Changing the standard ShowMessage dialog in any way (different font etc.) will negate these advantages.".

I do not want to negate those advantages, but as it is the dialog appears too small in higher resolutions. I would like to resize font size according to the screen resolution so that it would appear the same on any resolution.

Share this post


Link to post
2 hours ago, alogrep said:

I do not want to negate those advantages, but as it is the dialog appears too small in higher resolutions. I would like to resize font size according to the screen resolution so that it would appear the same on any resolution.

Make your application DPI aware and the dialog should be same on every settings.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×