When AutoSize is True, the control enlarges itself to accommodate the addition of a scroll bar unless the control is at or near its maximum size.įor a multiline TextBox, you can display scroll bars by using the ScrollBars, WordWrap, and AutoSize properties. When ScrollBars is set to fmScrollBarsHorizontal or fmScrollBarsBoth, the control displays a horizontal scroll bar if the text is longer than the edit region and if the control has enough room to include the scroll bar underneath its edit region. When ScrollBars is set to fmScrollBarsNone, no scroll bar is displayed. Scroll bars are hidden or displayed according to the following rules: Negative values and values greater than the scroll size are both valid.įor a single-line control, you can display a horizontal scroll bar by using the ScrollBars and AutoSize properties. If a scroll bar is not visible, you can set its scroll position to any value. The range of a scroll bar changes when the value of the ScrollBars property changes, the scroll size changes, or the visible size changes. It also modifies the scroll position as needed to keep the entire scroll bar visible. If visible, a scroll bar constrains its scroll box to the visible region of the scroll bar. If the KeepScrollBarsVisible property is True, any scroll bar on a form or page is always visible, regardless of whether the object's contents fit within the object's borders. The settings for fmScrollBars are: Constantĭisplays both a horizontal and a vertical scroll bar. The ScrollBars property syntax has these parts: Part Specifies whether a control, form, or page has vertical scroll bars, horizontal scroll bars, or both.