[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
https://bugzilla.novell.com/show_bug.cgi?id=426830
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;
Console.WriteLine(clientRectangle.ToString());
//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;
Console.WriteLine(clientRectangle.ToString());
Size size2 = rs.Size;
//Set SelectionStart which changes the client rectangle width.
rs.SelectionStart = 0;
clientRectangle = rs.ClientRectangle;
Size size3 = rs.Size;
Console.WriteLine(clientRectangle.ToString());
if (size1.Width != size2.Width || size1.Width != size3.Width)
Console.WriteLine("Sizes Should be the Same!");
Application.Run (f);
}
}
Actual Results:
{X=0,Y=0,Width=96,Height=92}
{X=0,Y=0,Width=96,Height=92}
{X=0,Y=0,Width=96,Height=92}
Expected Results:
{X=0,Y=0,Width=96,Height=92}
{X=0,Y=0,Width=96,Height=92}
{X=0,Y=0,Width=79,Height=92}
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