Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help setting up browse scroll bar positioning

Status
Not open for further replies.

rleiman

Programmer
May 3, 2006
258
US
Hi Everyone,

I have 2 questions.

Can you tell me how to get the scrollbar positioning to be the same as in a standard windows application?

How do I get the thumb control size in the scrollbar to reflect the total number of rows in a listbox?

I set the scrollbar in my listbox to use the default runtime option but when I drag the thumb control the listbox, data does not scroll. The thumb control pops back to the middle. The data scrolls if I use the up and down keys or page keys. There are about 300 rows of data in the listbox. Also in another listbox with 30 rows, the thumb control is the same size as the listbox with 300 rows. I thought it would be bigger.

Thanks in advance.

Emad-ud-deen Richard Leiman
 
Hi Emad,

Scroll Bar control can ONLY be accurate on a FILE loaded Listbox as it knows how many rows are there to scroll. On a PAGE loaded listbox it's a sort of fuzzy logic. Read the help on the different THUMB strategies.

Regards
 
Hi ShankarJ,

The listbox is in a browse procedure which came from the browse wizard so I am assuming it's a file loaded listbox.

Thanks.

Emad-ud-deen Richard Leiman
 
Hi Emad,

No. The defauly is Page-Loaded. Check the Browse properties. File-Loaded is ideal for small tables. ALL Drop Lists including COMBOs are File-Loaded.

From the HELP :

Scroll Bar Behavior button

Pressing this button displays a dialog where you can define the way a scroll bar works.

Choose from Fixed Thumb or Movable Thumb.

For file loaded lists, you automatically get Standard Windows standard (movable thumb) scroll bar behavior. However, since this is not possible for page loaded lists, these options let you choose the behavior that best suits your application.

Fixed Thumb
The thumb (square 3D box in the middle of the scroll bar) remains in the center of the scroll bar. CLICK above the thumb to scroll up one "page." CLICK below the thumb to scroll down one "page." DRAG the thumb to the top or bottom of the scroll bar to scroll the top or bottom of the file.

Choose Fixed Thumb when browsing large SQL tables to get best performance.

Movable Thumb
CLICK and DRAG the thumb to scroll a proportional distance in the list. The thumb remains where you drag it, and its position on the scroll bar indicates the relative position within the browse list.

CLICK above the thumb to scroll up one "page." CLICK below the thumb to scroll down one "page".

When you choose Movable Thumb, you can also set the Key Distribution to further define how the BrowseBox evaluates the thumb's relative position within the browse list.

Key Distribution
Specifies the distribution of the points of the scroll bar. Choose one of the two predefined distributions (Alpha or Last Names), or Custom, or Run-time from the drop-down list.

Alpha
Defines 100 evenly distributed points alphabetically.
Last Names
Defines 100 points distributed as last names are commonly found in the United States. If the access key is numeric, you should use a custom or run-time distribution.
Custom
Lets you define your own points.
Run-time
Reads the first and last record and computes the values for 100 evenly distributed points in between.
Custom Key Distribution
Lets you specify the break points for distribution along the scroll bar (useful when you have data with a skewed distribution). Insert the values for each point in the list. String constants should be in single quotes ( ' ' ).

Run-time Distribution Parameters
Lets you specify the type of characters considered when determining the distribution points. This is only appropriate when the Free Key Element is a STRING or CSTRING. Check the boxes for the types of characters you wish to include for consideration. Choose from Use alpha characters (Aa-Zz), Use numeric characters (0-9), and Use other keyboard characters.


Regards
 
Hi SankarJ,

I used the Movable Thumb and Run-time settings.

The help says:
"CLICK and DRAG the thumb to scroll a proportional distance in the list. The thumb remains where you drag it, and its position on the scroll bar indicates the relative position within the browse list."

but for me, it pops back to the middle of the scroll bar. Is there something else I can set to stop it from popping back to the middle and to remain where I dragged it?

Thanks.

Truly,

Emad-ud-deen Richard Leiman
 
Hi Emad,

Have you set the Browse to FILE-LOADED? Movable Thumb works for FILE-LOADED only.

For file loaded lists, you automatically get Standard Windows standard (movable thumb) scroll bar behavior. However, [red]since this is not possible for page loaded lists[/red], these options let you choose the behavior that best suits your application.

Regards
 
Hi ShankarJ,

It was page loaded so I changed it to file loaded but it gets locked in some kind of loop. The only way out is to break into the program with the windows task manager. When I set it back to page loaded the lockup does not occur. Can you tell me how to get it not to lockup in file loaded mode?

Thanks.

Emad-ud-deen Richard Leiman
 
Hi Emad,

The option to FILE-load is chosen ONLY when the no of rows returned (based on whatever filter criteria you use) are small i.e. < 200. If you try to file-load a table returning 10000 rows, it WILL take a long time as it has to first load the Browse queue with 10000 records before displaying it. The reason why the scroll bar cannot work accurately for Page-loaded browses is because it DOES NOT know the number of rows in the result set. All it loads every time is the number of rows that can be displayed in ONE page and that depends on the size of the List Control. So, forget getting the scroll bar to work and stick to Page-loaded browses which offer performance.

By the way, what is the Database driver you are using?

Regards
 
Hi ShankarJ,

Ok. I will take the advice on your reccomdation.

The driver is Topspeed.

By the way, I re-created the procedure but this time it was from the "Simple Window" template instead of a Browse template, and I built the listboxes by hand throught the control templates and I was able to define the main listbox as "File Loaded" and I did not get cautht in that loop. It works fine for the 700 table rows I have.

Thanks.

Truly,
Emad-ud-deen Richard Leiman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top