This Question is Answered

15 "helpful" answers available (3 pts)
2 Replies Last post: Jun 30, 2008 10:10 PM by markecho

How to hide the scrollbar of TextArea?

Jun 30, 2008 7:38 PM

Click to view markecho's profile Level 2 markecho 35 posts since
Oct 17, 2007

As the title say, How to hide the scrollbar of TextArea?

Make a TextArea looks like a TextField.

Thanks a lot.

Click to view carl's profile Curl carl 83 posts since
Oct 17, 2007
1. Re: How to hide the scrollbar of TextArea? Jun 30, 2008 9:31 PM
It's not officially supported, but the following example should work with either StandardTextAreaUI or SkinnableTextAreaUI:

{value
    def ta = {TextArea}
    {type-switch ta.ui-object
     case base:BaseMultiLineTextControlUI do
        {if-non-null sb = base.scrollbox then
            set sb.always-disable-vscroll? = true
            set sb.shrink-vscroll? = true
        }
    }
    ta
}


If the ui-object on the Control changes, you'll have to repeat the operation. Alternately, if you're defining and using your own subclass of {BaseMultiLineTextControlUI-of ...} as the ui-object, you could clean this up a bit and override its create-contents method to set these two options on the ScrollBox (BaseTextAreaScrollBox) returned by super.

(As one of these vscroll options is directly set by the UI, you wouldn't be able to use a StyleSheet to change this.)
Click to view markecho's profile Level 2 markecho 35 posts since
Oct 17, 2007
2. Re: How to hide the scrollbar of TextArea? Jun 30, 2008 10:10 PM
in response to: carl

many thanks, carl, your answer is great ,

Now I'm learning Curl, so,

sometimes some questions that maybe easy to resolve by you trouble me.

anyway, thank you for your patient answers.