This is a migrated thread and some comments may be shown as answers.

RadMessageBox large text height problem

19 Answers 408 Views
MessageBox
This is a migrated thread and some comments may be shown as answers.
DGPunkt
Top achievements
Rank 1
DGPunkt asked on 17 Dec 2009, 01:24 PM
Hello everybody,

we´re (still) updating to RadControls Q3SP1 an we still experience problems with RadMessageBox and large text, like 4000 characters.

In the program we collect multiple messages and append them to a StringBuilder using AppendLine. If this text exceeded 4000 characters, it is cut (StringBuilder.Length = 4000) and a "text-was-cut-message" is appended, so the resulting string has about 4100 charaters and is passed to the RadMessageBoxes Show method.
The resulting MessageBox shows the whole text in the upper portion of the control and is that big (rest (half) of the messagebox is empty), you can´t click "Ok-Button", because it´s located just under the bottom of my monitor.

So, if text is that big - we have to use MS MessageBox.

What I found out while making the screenshot is, that this behaviour depends on the text. I tried to make an example where I put a space after every 50 or 100 characters and a newline after every 500 characters and the text was almost shown as expected.


Greetings,
Daniel

19 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 18 Dec 2009, 08:25 AM
Hello DGPunkt,

Thank you for writing. You have run across a known issue with the TextPrimitive that has been used in RadMessageBox object. We are going to address this in the next release (it is possible to include a fix in the next internal builds as well). Currently, you can place the <html> tag before your string. If this does not help, you can try to manually format the text in a couple of rows by including new lines in your string. 

Greetings, Martin Vasilev
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
moftol
Top achievements
Rank 1
answered on 24 Mar 2013, 01:50 PM
Dears,

I have a problem i am using Telerik windows form rad message box and display arabic text in the rad message box, but the problem is  that text wrap to second line(although the message is very short and no need to go in second line) and is not visible, the same text is working fine when i use .NET Core MessageBox.

Some times rad messagebox shows a very big message in one or two lines and that is visible.
i dont understand the exact problem, whether  some characters are creating the problem or what ??, i have matched the character in different message but find no clue :(

any suggestions.

Thank you.
0
moftol
Top achievements
Rank 1
answered on 26 Mar 2013, 11:27 AM
a reply is needed by the good as well as by the bad people if some one face this issue or may have some clue.

Thanks.
0
moftol
Top achievements
Rank 1
answered on 26 Mar 2013, 12:19 PM

Please find the attached images for more clarification.
  • Arabic text problem in Rad Message Box
  • same text is showing perfect in Windows Message Box.


Thanks.


0
Anton
Telerik team
answered on 27 Mar 2013, 02:53 PM
Hello Farooq,

Thank you writing.

In version Q1 2013(2013.1.220) we had an issue with RadMassageBox that may lead to the undesired behavior in your case. I am glad to inform you that this issue is already resolved in our latest release Q1 2013 SP1 (2013.1.320). So my advice is to upgrade to latest version and if you continue to experience the issue to provide code snippets that demonstrate your case so I can investigate it and provide you with adequate assistance.

I hope this helps. I am looking forward to your reply.

Greetings,
Anton
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
moftol
Top achievements
Rank 1
answered on 02 Apr 2013, 07:44 AM

Thank you Anton.

We are looking to upgrade the telerik controls and if issues arise again, we will put a support ticket.


Thanks.
0
moftol
Top achievements
Rank 1
answered on 02 Apr 2013, 09:02 AM
Hi Anton,

can we manipulate Telerik Rad MessageBox functionality through reflection.

Thanks.
0
Anton
Telerik team
answered on 02 Apr 2013, 01:19 PM
Hi Farooq,

Thank you for writing back.

Yes, you can manipulate the functionality through reflection. There are cases when we are providing  workarounds with reflection due implementation of members that are not public and cannot be accessed without reflection. But to be able to assist you I need more information about your case and what you are trying to accomplish. So please open support ticket where you can attache project and steps how to reproduce the issue and I will be glad to help further.

I am looking forward to your reply.

Greetings,
Anton
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Francisco
Top achievements
Rank 2
answered on 28 Feb 2014, 01:01 AM
Example:

RadMessageBox.Show("<html>One Line<br/>Second Line</html>", ":: Notice ::", MessageBoxButtons.OK, RadMessageIcon.Info);

Kind Regards.
0
George
Telerik team
answered on 04 Mar 2014, 04:53 PM
Hi Francsco,

Thank you for replying.

Can you please elaborate your latest post? I find it hard to understand what you are trying to accomplish or what your goal is. I tested the provided code with the latest version (2014.1 226) and it seems to work as expected.

Looking forward to your response.

Regards,
George
Telerik
0
Francisco
Top achievements
Rank 2
answered on 04 Mar 2014, 05:14 PM
This Example, is to create diffence sections when you have a big text that you want to show on RadMessage, the first step is set the tags <html>Message</html>, with this tags you can enable html mode on RadMessage, and you will be setting differents secctions with the tag <br/> with this you can create a big text on RadMessage.

RadMessageBox.Show("<html>One Line<br/>Second
Line</html>", ":: Notice ::", MessageBoxButtons.OK,
RadMessageIcon.Info);

Kind Regards.
0
George
Telerik team
answered on 07 Mar 2014, 02:18 PM
Hello Francisco,

Thank you for your reply.

I tested with a few lines and the behavior still seems OK on my end. Can you please share your concerns, what behavior you are expecting etc. ? Moreover I am attaching a screenshot of the shown RadMessageBox for reference.

Looking forward to your reply.

Regards,
George
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
Francisco
Top achievements
Rank 2
answered on 12 Mar 2014, 05:33 PM
I have realized other example:

RadMessageBox.Show("<html><b><span style=\"color:#f26609; font-size:18pt\">Title:</span></b><br/><br/><span style=\"color:blue; font-size:16pt\">Error on Save..!!</span><br/><span style=\"color:gray; font-size:12pt\">Check with your Administrator.</span></html>", ":: Notice ::", MessageBoxButtons.OK, RadMessageIcon.Exclamation);

You can see the image attached.

I hope to answer your questions.

Kind Regards.
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 04 Dec 2018, 05:06 AM
how to change radmessgebox Button color and title bar color ?? 
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Dec 2018, 11:34 AM
Hello, Raneesras,    

The following code snippet demonstrates how to customize the OK button's color and title bar' color:

private void radButton1_Click(object sender, EventArgs e)
{
    RadButton OKbutton = RadMessageBox.Instance.Controls["radButton1"] as RadButton;
    OKbutton.BackColor = Color.Red;
    OKbutton.ButtonElement.ButtonFillElement.GradientStyle = GradientStyles.Solid;
    RadMessageBox.Instance.FormElement.TitleBar.TitleBarFill.BackColor = Color.Yellow;
    RadMessageBox.Instance.FormElement.TitleBar.TitleBarFill.GradientStyle = GradientStyles.Solid;
    RadMessageBox.Show("Text", "Caption", MessageBoxButtons.OK);
}



I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 05 Dec 2018, 04:11 AM

thank you dess for the reply...i found it on another way....

 

 RadMessageBox.Instance.ButtonSize = new System.Drawing.Size(95, 30);
            RadMessageBox.Instance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.Formcolor1)))), ((int)(((byte)(AppTheme.Formcolor2)))), ((int)(((byte)(AppTheme.Formcolor3)))));

            RadMessageBox.Instance.FormElement.TitleBar.TitlePrimitive.StretchHorizontally = true;
            RadMessageBox.Instance.FormElement.TitleBar.TitlePrimitive.TextAlignment = ContentAlignment.MiddleLeft;
            RadMessageBox.Instance.FormElement.TitleBar.Font = new Font("Verdata", 8f, FontStyle.Bold | FontStyle.Regular);

            //RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive
            RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
            RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
            RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.BackColor3 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
            RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.BackColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
            RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
            RadMessageBox.Instance.FormElement.TitleBar.BorderPrimitive.BoxStyle = Telerik.WinControls.BorderBoxStyle.SingleBorder;
            RadMessageBox.Instance.FormElement.TitleBar.BorderPrimitive.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
            RadMessageBox.Instance.FormElement.TitleBar.TitlePrimitive.ForeColor = Color.White;
            foreach (Control control in RadMessageBox.Instance.Controls)
            {
                if (control is RadButton)
                {
                    string name = control.Name;
                    ((Telerik.WinControls.Primitives.TextPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(1).GetChildAt(1)).ForeColor = Color.White;
                    ((Telerik.WinControls.Primitives.FillPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(0)).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
                    ((Telerik.WinControls.Primitives.FillPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(0)).BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
                    ((Telerik.WinControls.Primitives.FillPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(0)).BackColor3 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
                    ((Telerik.WinControls.Primitives.FillPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(0)).BackColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
                    control.Font = new Font("Verdata", 11f, FontStyle.Regular | FontStyle.Regular);
                    // control.Size = new System.Drawing.Size(98, 36);
                    ((RadButton)control).MouseEnter += new System.EventHandler(RadMessageBoxButton_MouseEnter);
                    ((RadButton)control).MouseLeave += new System.EventHandler(RadMessageBoxButton_MouseLeave);
                }
                else if (control is RadLabel)
                {
                    string name = control.Name;
                    control.Font = new Font("Verdata", 11f, FontStyle.Regular | FontStyle.Regular);
                }
                else if (control is PictureBox)
                {
                    ((PictureBox)control).MouseEnter += new System.EventHandler(RadMessagepictureBox1_MouseEnter);
                    ((PictureBox)control).MouseLeave += new System.EventHandler(RadMessagepictureBox1_MouseLeave);

                }

0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 05 Dec 2018, 04:14 AM
RadMessageBox.Instance.ButtonSize = new System.Drawing.Size(95, 30);
           RadMessageBox.Instance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.Formcolor1)))), ((int)(((byte)(AppTheme.Formcolor2)))), ((int)(((byte)(AppTheme.Formcolor3)))));
 
           RadMessageBox.Instance.FormElement.TitleBar.TitlePrimitive.StretchHorizontally = true;
           RadMessageBox.Instance.FormElement.TitleBar.TitlePrimitive.TextAlignment = ContentAlignment.MiddleLeft;
           RadMessageBox.Instance.FormElement.TitleBar.Font = new Font("Verdata", 8f, FontStyle.Bold | FontStyle.Regular);
 
           //RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive
           RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
           RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
           RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.BackColor3 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
           RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.BackColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
           RadMessageBox.Instance.FormElement.TitleBar.FillPrimitive.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
           RadMessageBox.Instance.FormElement.TitleBar.BorderPrimitive.BoxStyle = Telerik.WinControls.BorderBoxStyle.SingleBorder;
           RadMessageBox.Instance.FormElement.TitleBar.BorderPrimitive.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
           RadMessageBox.Instance.FormElement.TitleBar.TitlePrimitive.ForeColor = Color.White;
           foreach (Control control in RadMessageBox.Instance.Controls)
           {
               if (control is RadButton)
               {
                   string name = control.Name;
                   ((Telerik.WinControls.Primitives.TextPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(1).GetChildAt(1)).ForeColor = Color.White;
                   ((Telerik.WinControls.Primitives.FillPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(0)).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
                   ((Telerik.WinControls.Primitives.FillPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(0)).BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
                   ((Telerik.WinControls.Primitives.FillPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(0)).BackColor3 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
                   ((Telerik.WinControls.Primitives.FillPrimitive)((RadButton)control).GetChildAt(0).GetChildAt(0)).BackColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(AppTheme.RadCommandBarBackcolor1)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor2)))), ((int)(((byte)(AppTheme.RadCommandBarBackcolor3)))));
                   control.Font = new Font("Verdata", 11f, FontStyle.Regular | FontStyle.Regular);
                   // control.Size = new System.Drawing.Size(98, 36);
                   ((RadButton)control).MouseEnter += new System.EventHandler(RadMessageBoxButton_MouseEnter);
                   ((RadButton)control).MouseLeave += new System.EventHandler(RadMessageBoxButton_MouseLeave);
               }
               else if (control is RadLabel)
               {
                   string name = control.Name;
                   control.Font = new Font("Verdata", 11f, FontStyle.Regular | FontStyle.Regular);
               }
               else if (control is PictureBox)
               {
                   ((PictureBox)control).MouseEnter += new System.EventHandler(RadMessagepictureBox1_MouseEnter);
                   ((PictureBox)control).MouseLeave += new System.EventHandler(RadMessagepictureBox1_MouseLeave);
 
               }
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Dec 2018, 07:55 AM
Hello, Raneesras,    

I am glad that you have found a solution that suits your requirement. However, I would like to note that accessing the child elements of a certain control will lower the code readability and it may be difficult to maintain it later. That is why I would highly recommend you to access the desired control from the Controls collection of the RadMessageBox.Instance. Then, use the publicly exposed properties for customizing the style.

I hope this information helps.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 05 Dec 2018, 08:21 AM
thank you mr.Dess
Tags
MessageBox
Asked by
DGPunkt
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
moftol
Top achievements
Rank 1
Anton
Telerik team
Francisco
Top achievements
Rank 2
George
Telerik team
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or