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

Submitter:  None
Submitted:  Mon 10 Jan 2005 12:21:29 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  darkdust
Open/Closed:  Closed

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

Fixed by patch #3630, closing bug.

Marc Haisenko <darkdust>
Group Member
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

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-02-02 darkdust StatusNone Fixed
    Assigned toNone darkdust
    Open/ClosedOpen Closed
2005-01-10 None Attached File- Added TextBoxTest.zip, #2050

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code