how to limit the width of radmessagebox

4 posts, 1 answers
  1. Jacky
    Jacky avatar
    23 posts
    Member since:
    Mar 2014

    Posted 20 Aug 2014 Link to this post

    how to limit the width of radmessagebox to force the text was shown in more lines?  it looks very long for me.

  2. Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 22 Aug 2014 Link to this post

    Hi Jacky, 

    Thank you for contacting us. 

    You need to set the MaximumSize property of the label which displays the message text. Please take a look at the following code example: 
    RadMessageBox.Instance.Controls["radLabel1"].MaximumSize = new System.Drawing.Size(300, 500);

    I attached an image and sample project which demonstrates you the message box.
     
    Should you have further questions, I would be glad to help.

    Regards,
    Ralitsa
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jacky
    Jacky avatar
    23 posts
    Member since:
    Mar 2014

    Posted 25 Aug 2014 Link to this post

    Hi Ralitsa,

    Thanks for your help.
    It doesn't work well,  you can try to click the button again to see the effect.  the two buttons are disabled.
  5. Answer
    Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 27 Aug 2014 Link to this post

    Hi Jacky, 

    Thank you for your reply.  

    I have attached the modified sample project. The solution is based on method which calculates the height of text and sets the MinimumSize and MaximumSize properties of the label. 

    I hope this will help. Do not hesitate to write back with further questions.

    Regards,
    Ralitsa
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top