bugDotGNU Portable.NET - Bugs: bug #11553, TextBox doesn't correctly handle...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #11553: TextBox doesn't correctly handle scrollbars

Submitted by:  None
Submitted on:  Mon 10 Jan 2005 12:21:29 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Marc Haisenko <darkdust>
Open/Closed: Closed

Wed 02 Feb 2005 01:57:41 PM UTC, comment #1:

Fixed by patch #3630, closing bug.

Marc Haisenko <darkdust>
Project MemberIn charge of this item.
Mon 10 Jan 2005 12:21:29 PM UTC, original submission:

Conditions:
- TextBox.Multiline = true
- TextBox.ScrollBars = ScrollBars.Vertical (force the vertical scrollbar to be visible)
- TextBox must be the child of a Form (or maybe Control ?) that isn't visible

If these conditions are met and you assign a new text to the textbox and then show the dialog it can happen that some text disappears under the scrollbar instead of getting wrapped. The attached test application shows this bug.

The problem is that in TextBox.cs the visibility of scrollbars is set directly with the ScrollBar.Visible property. But this property returns false if its parent's Visible returns false. If the textbox is a child of a Form that isn't visible yet then the ScrollBar.Visible property returns false although it was set to true earlier.

This screws the layout calculations, they are calculated as if the scrollbar was not visible. When the textbox finally gets visible there is no relayouting done.

There are two solutions that I can see so far:

The easy one is to add an OnVisibleChanged handler that relayouts the text when the textbox gets visible. Layouting is done twice here.

The better one which I'll implement and provide a patch for is to have two internal bools which save whether the vertical and horizontal scrollbar will be visible, all calculations then use these bools and not ScrollBar.Visible.

Anonymous

 

Attached Files
file #2349:  TextBoxTest.zip added by None (29KiB - application/x-zip - Test application that demonstrates this bug)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 02 Feb 2005 01:57:41 PM UTCdarkdustStatusNone=>Fixed
  Assigned toNone=>darkdust
  Open/ClosedOpen=>Closed
Mon 10 Jan 2005 12:21:30 PM UTCNoneAttached File-=>Added TextBoxTest.zip, #2050

Back to the top


Powered by Savane 3.1-cleanup1