none
C#NET2008 Messagebox.show Text Font Setting

    Question

  • Hullo Friends,

    I need your help. Please help me.

    I am wondering how to set the font style for the contents of the Messagebox.show Text.   The user Manager asked me to display the content as BOLD but I couldn't do it.

    Here are the coding:

    string txtMsg = "Ensure the Sale Order Date is not  empty";

    Messagebox.show(txtMsg, "Invalid Sales OrderDate");

    Thank you for helping me. Once I got the coding working I will post it here to share with others who may have similar problem.

     

     

     


    Thank you very Much, Have a Good Day. Cheers, Lennie
    Wednesday, March 16, 2011 2:46 AM

Answers

  • The MessageBox .Show() function simply calls the Windows API MessageBox function to show the message box.  As you can tell from the API function's documentation, there are no parameters to allow you to change the font.  The font is therefore based on the Windows font (ie the user's) settings. 

    If you really want to change the font, you'll have to create your own MessageBox window (form) which you can design however you like.

    ShaneB

    • Marked as answer by Tee Leong Wednesday, March 16, 2011 4:07 AM
    Wednesday, March 16, 2011 3:41 AM

All replies

  • The MessageBox .Show() function simply calls the Windows API MessageBox function to show the message box.  As you can tell from the API function's documentation, there are no parameters to allow you to change the font.  The font is therefore based on the Windows font (ie the user's) settings. 

    If you really want to change the font, you'll have to create your own MessageBox window (form) which you can design however you like.

    ShaneB

    • Marked as answer by Tee Leong Wednesday, March 16, 2011 4:07 AM
    Wednesday, March 16, 2011 3:41 AM
  • Hi Shane_B,

    Thank you very much for sharing information with me.

    Appreciate that very much.

    I have created a popup form to display message and it's working very well. That is wonderful. You are awesome and very generous in sharing information. Thank you very much.  I am so glad to meet you at this Wonderful Forum.

     


    Thank you very Much, Have a Good Day. Cheers, Lennie
    Wednesday, March 16, 2011 4:10 AM