Solved

LIST VIEW CONTROL - WHY DOESN't IT SCROLL?

Posted on 1998-12-26
4
197 Views
Last Modified: 2010-04-16
I have added items to a list view control which is contained
in a property sheet. The trouble is that the control is not big enough to display all the icons. I thought it would automatically have scroll bars when too many icons were added to it. Can anyone tell me if there is some setting that I have missed or any other way to enable scroll bars?
0
Comment
Question by:rangers99
4 Comments
 
LVL 2

Expert Comment

by:zyqwert
ID: 1181054
See if your list view has the style LVS_NOSCROLL (0x2000) using spy or GetWindowLong.

0
 
LVL 1

Expert Comment

by:The_Brain
ID: 1181055
did you do this via wizard?  if so then I could help.
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1181056
Did you create the listbox with the WS_VSCROLL style?
0
 

Author Comment

by:rangers99
ID: 1181057
No I created the listbox in the resource editor.

I dont know if the following code is helpful. It is in the InitDialog() function adds 24 items to the listbox control. I can only see the first 10 icons because there are no scroll bars.
Any ideas how to make the scroll bars appear?


m_ImageList.Create(IDB_TEXTURESBMP,32,24,RGB(255,255,255));
m_TexturesList.SetImageList(&m_ImageList, LVSIL_NORMAL);

LV_ITEM listItem;
listItem.mask = LVIF_TEXT | LVIF_IMAGE;
listItem.iSubItem = 0;

for(int nItem = 0; nItem<24; nItem++)
{
   listItem.iItem = nItem;
   listItem.pszText = m_TextureNames[nItem];
   listItem.iImage = nItem;
   m_TexturesList.InsertItem(&listItem);
}

 
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question