6

Possible Duplicate:
C# formatting a MessageBox

how to change the size of windows default MessageBox in c# . Is there any code for it ? i dont want to make my personalised dialog box ? so is there any solution to change the windows default messagebox size?

Community
  • 1
  • 1
Sunny
  • 618
  • 1
  • 7
  • 22
  • 2
    Write less or more text in title/message. – stefan Jul 06 '12 at 08:25
  • 2
    http://stackoverflow.com/a/5421126/763026 – Angshuman Agarwal Jul 06 '12 at 08:33
  • 1
    For my own standard windows forms applications I have just written a replacement for MessageBox that is resizable. You can download it here and use it like a standard MessageBox: http://www.codeproject.com/Articles/601900/FlexibleMessageBox-A-flexible-replacement-for-the Regards, Jörg – jreichert Jun 26 '13 at 09:50
  • 1
    what is the default size of a message and a text box ?? any one knw it ? – Raghu Jul 08 '13 at 13:54
  • It seems to break lines at some point. From a quick screenshot test it seems the message box width is 480 pixels at that point. – Nyerguds Nov 24 '15 at 11:37
  • Adding more text does not change width. Long text in the title is simply cut short and appended with `...`, while long text in the message is wrapped. – Wayne Sep 12 '16 at 16:20

3 Answers3

5

create custom form and set properties as you want

burning_LEGION
  • 13,246
  • 8
  • 40
  • 52
2

There is no code for this because it is not possible. For creating your own message box you can check this link for instance.

TOP KEK
  • 2,593
  • 5
  • 36
  • 62
  • 6
    Holy cow that's a bunch of code for something that can be done using a custom form (designed in seconds) and a call to `ShowDialog()`. – CodeCaster Jul 06 '12 at 08:32
1

You should try and make a custom class, that holds your design/properties.

You could make a function in your custom message box class, that will call your "Bigger messagebox" and set the text

CustomBox.Show("sdhsfs")

This may help with the class (You will have to add a size Tag to the constructor)

Also, the tutorial uses static methods, make an instance instead. This will allow multiple message boxes, all with different text.

Cyral
  • 13,999
  • 6
  • 50
  • 90