PDA

View Full Version : Horizontal scroll bar not appearing in list view control



Dsilva
06-28-2007, 03:19 AM
Hi,

I am using Installshield 11 Basic Msi Project type. The problem arises when I am trying to add the horizontal scroll bar in the List View control in one of the dialog.

The scenario is as follows:

Test Case 1:
1) Added the list view control in one of the existing dialog.
2) Added few items (say 2 rows) in the list view control whose length of the text is larger than the actual width size of the List view.
3) Build and run the project.

Observation:

1) The horizontal scroll bar does not appear during installation of the project.


Test Case 2:
1) Added the list view control in one of the existing dialog.
2) Added few items (say 8 rows) in the list view control whose length of the text and the number of the rows is larger than the actual width and the height of the List view.
3) Build and run the project.

Observation:

1) Both the horizontal and vertical scroll bar appears. It means only if the length of the rows is greater than the list view size, then the horizontal scroll bar appears.

I tried the same in Installshield 12 version (Basic MSI project), Installshield 2008. Still the same problem as in IS 11.

Hence please do let me know how I could enable the horizontal scroll bar. Also please do let me know if this is a known issue in Installshield or a bug in installshield.

Looking forward to hear from you soon.

Thanks & Regards,
D’silva

RobertDickau
07-02-2007, 05:48 PM
The appearance and behavior of dialog-box controls in a Basic MSI project is controlled by the Windows Installer engine, and not by any InstallShield run-time engine, so if there's no attribute for the ListView table to enable the horizontal scroll bar, I'm not sure there's much we can do about it...

Is it an option for you to use a ListBox control instead of the ListView control? In a quick test, I see the horizontal scroll bar for a long text value even if all the rows fit vertically in the control.

jsparks
10-04-2007, 02:54 PM
I have both IS 11.5 and 2008 and when I select Other Window Styles I do not see a check box for the horizontal scroll bar in a ListBox.(vertical is there)

I was able to work around this by manually setting

Other Window Style = 3211265

This setting equates to LBS_NOTIFY | WS_VSCROLL | WS_TABSTOP | WS_HSCROLL

Once that is done you need to add code to your custom dialog script to activate the scroll bar using SendMessage.

//Define for SendMessage for Horizontal scroll bar
#define LB_SETHORIZONTALEXTENT 0x0194


nRet = SendMessage (hwndList,LB_SETHORIZONTALEXTENT, nNewWidth*5,0);


The 3rd argument for SendMessage specifies the Horizontal extent of the scrollbar. This measuerment is in pixels not bytes or chars. Since I was in a hurry I just used a length that is 5 times the largest string that is stored in the listbox.

nWidth = StrLength(szString);
if nWidth >= nNewWidth then
nNewWidth = nWidth;
endif;

I hope this helps anyone else that would like horizontal scroll bars on their ListBox.