Tip of the Month (November 2005)
Creating a Horizontal Scrollbar for a Grid
Visual CE provides a grid control that can be used to display
related records from another table. But if you choose too many
columns to display, each column is too narrow. Here's how to
increase the horizontal area available for the columns and add
a horizontal scrollbar to your grid:
- Create the grid control as you normally would: Select
CONTROL | GRID, specify the search key and the
application to launch when the user double-clicks a row in
the grid control, and use the Add After and
Add Before to add the columns to the grid. Click
OK to close the properties dialog.
- Click on the sizing handle on the side of the control and
stretch the control horizontally. Make the control wide
enough to cover the entire scrollable area you desire. For
example, if the control is 200 pixels wide but you want your
user to be able to scroll back and forth in a 400 pixel range,
make the control 400 pixels wide. You may have to select
FORM | FORM SIZE and make your form wider in order to
do this. Note: The handle on the right may be obscured, so you
may have to use the handle on the left to do this.
- Double click the control to bring up its properties box.
- Click the Widths button and adjust the widths of the
column by clicking on and dragging the vertical lines. When
all the widths are set the way you want, click OK.
Click OK again to close the properties dialog.
- Click on the sizing handle on the side of the control and
shrink the control back to its original size horizontally.
If you changed FORM | FORM SIZE in step (2), you may
want to reset this also.
Visual CE will create a horizontal scroll bar for the grid
control.