# Dialog Scrolling > [HTML Version](dialogscrolling.htm) _Added December 2013_ Dialogs can be made vertically scrollable by specifying the WS\_VSCROLL in the _winstyle_ parameter when the dialog is created. For example: | | | |------|------| | _(./images/ashref_img128.jpg)_ ...
| _(./images/ashref_img129.jpg)_ | **Code for example above.** \! create dialog with vertical scroll bar winstyle = WS\_VSCROLL xcall AUI, AUI\_CONTROL, CTLOP\_ADD, "dlg1", "Scrolling Dialog", \& MBST\_ENABLE, MBF\_DIALOG, NUL\_CMD\$, NUL\_FUNC\$, NUL\_CSTATUS, \& 4000, 10000, 10000, 40000, NUL\_FGC, NUL\_BGC, \& NUL\_FONTATTR, NUL\_FONTSCALE, NUL\_FONTFACE\$, NUL\_TOOLTIP\$, \& NUL\_PARENTID, NUL\_WINCLASS\$, winstyle, NUL\_WINSTYLEX, NUL\_CTYPE2 \! create a bunch of fields that extend arbitrarily below bottom of dialog row = 500 for fno = 1 to num'fields row += 1000 xcall SBXINP, "<2>"+label\$(fno), INFOP\_DISPLAY, row, 8, xmax(fno), \& field\$(fno), "|GA||C\]g123T", setdef\$, 50, fno+100, tooltip\$, "dlg1", \& exitcode, -1, 0, 0, -1 next fno The scroll bar will be automatically configured / calibrated as fields are added to the dialog, and the EVENTWAIT routine will automatically scroll the currently focused field into view. Note that this works for all types of dialogs, including MBF\_DLGNOCAP dialogs, which can be positioned within parent windows or panels (such as Tab panels), allowing you to effectively creating scrollable regions within a larger window. _(./images/ashref_img130.jpg)_ **Code for example above.** To produce this dialog, we modify the code from the first example as follows: \! main dialog (not scrollable) xcall AUI, AUI\_CONTROL, CTLOP\_ADD, "dlg0", "Dialog with scrollable region", \& MBST\_ENABLE, MBF\_DIALOG, NUL\_CMD\$, NUL\_FUNC\$, NUL\_CSTATUS, \& 4000, 10000, 12000, 40000, NUL\_FGC, \&hffeeee \! ok and cancel buttons at top, in non-scolling region xcall AUI, AUI\_CONTROL, CTLOP\_ADD, "btnOK", "OK", \& MBST\_ENABLE, MBF\_BUTTON+MBF\_KBD, "VK\_xF5", NUL\_FUNC\$, NUL\_CSTATUS, \& 1500, 13000, 3000, 20000 xcall AUI, AUI\_CONTROL, CTLOP\_ADD, "btnCancel", "Cancel", \& MBST\_ENABLE, MBF\_BUTTON+MBF\_KBD, "VK\_ESC", NUL\_FUNC\$, NUL\_CSTATUS, \& 1500, 22000, 3000, 29000 \! scrollable borderless dialog within main dialog xcall AUI, AUI\_CONTROL, CTLOP\_ADD, "dlg1", NUL\_CTEXT\$, \& MBST\_ENABLE, MBF\_DIALOG, NUL\_CMD\$, NUL\_FUNC\$, NUL\_CSTATUS, \& 3000, 0, 8500, 31000, NUL\_FGC, \&hffdddd, \& NUL\_FONTATTR, NUL\_FONTSCALE, NUL\_FONTFACE\$, NUL\_TOOLTIP\$, \& NUL\_PARENTID, NUL\_WINCLASS\$, WS\_VSCROLL+WS\_BORDER, NUL\_WINSTYLEX, \& MBF2\_DLGNOCAP+MBF2\_STICKY \! create a bunch of fields that extend arbitrarily below bottom of window \!