[Mono-bugs] [Bug 426830] New: RichTextBox - ClientRectangleWidth is Incorrect when scroll bars are visible .

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 16 23:37:08 EDT 2008


           Summary: RichTextBox - ClientRectangleWidth is Incorrect when
                    scroll bars are visible.
           Product: Mono: Class Libraries
           Version: SVN
          Platform: i386
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: johnm at hlaustralia.com.au
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User

Description of Problem:

Client Rectangle returns the incorrect width when scroll bars are visible.

using System;
using System.Windows.Forms;
using System.Drawing;

public class test
        static void Main ()
                Form f = new Form ();

                RichTextBox rs = new RichTextBox();
                rs.Parent = f;
                rs.Text = "abc";

                Rectangle clientRectangle = rs.ClientRectangle;
                Size size1 = rs.Size;


                //Display Scroll bars, no focus yet so client rectangle has
correct size.
                rs.Text = "1\n\n\n\n\n\n\n\n\n\n";               
                clientRectangle = rs.ClientRectangle;             
                Size size2 = rs.Size;

                //Set SelectionStart which changes the client rectangle width.
                rs.SelectionStart = 0;
                clientRectangle = rs.ClientRectangle;
                Size size3 = rs.Size;


                if (size1.Width != size2.Width || size1.Width != size3.Width)
                        Console.WriteLine("Sizes Should be the Same!");         

                Application.Run (f);

Actual Results:

Expected Results:

How often does this happen? 
Every Time.

Additional Information:

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list