CListCtrl problem
-
Dear All, I want to display items in a CListCtrl but by default the Horizontal scroll bar is appearing if I add more items in the list. But I need to display only Vertical bars if I add more items. I use like below : <pre> m_List.EnableScrollBar(SB_VERT, true); m_List.EnableScrollBar(SB_HORZ,false); The above works only if the list is having minimum items, when it exceeds the client area then only Horizontal bar is working and Vertical bar is shown but not working.
-
Dear All, I want to display items in a CListCtrl but by default the Horizontal scroll bar is appearing if I add more items in the list. But I need to display only Vertical bars if I add more items. I use like below : <pre> m_List.EnableScrollBar(SB_VERT, true); m_List.EnableScrollBar(SB_HORZ,false); The above works only if the list is having minimum items, when it exceeds the client area then only Horizontal bar is working and Vertical bar is shown but not working.
Possibly you need to use the
LVS_REPORT
style. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Possibly you need to use the
LVS_REPORT
style. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]When I use Report Style, even I cannot add the items in the list.
//List Control parameters
//CONTROL "",IDC_LIST1,"SysListView32",LVS_LIST | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,112,23,84,114 (even I tried LVS_REPORT)
m_List.EnableScrollBar(SB_VERT, true);
m_List.EnableScrollBar(SB_HORZ,false);
CString strText;
int nColumnCount = 0;
for (int i=0;i < 20;i++)
{
strText.Format(TEXT("item %d"), i);
// Insert the item
m_List.InsertItem(i, strText);
} -
When I use Report Style, even I cannot add the items in the list.
//List Control parameters
//CONTROL "",IDC_LIST1,"SysListView32",LVS_LIST | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,112,23,84,114 (even I tried LVS_REPORT)
m_List.EnableScrollBar(SB_VERT, true);
m_List.EnableScrollBar(SB_HORZ,false);
CString strText;
int nColumnCount = 0;
for (int i=0;i < 20;i++)
{
strText.Format(TEXT("item %d"), i);
// Insert the item
m_List.InsertItem(i, strText);
}bhanu_8509 wrote:
m_List.EnableScrollBar(SB_VERT, true); m_List.EnableScrollBar(SB_HORZ,false);
You don't need the above lines.
bhanu_8509 wrote:
When I use Report Style, even I cannot add the items in the list
What does it mean? :confused: :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
bhanu_8509 wrote:
m_List.EnableScrollBar(SB_VERT, true); m_List.EnableScrollBar(SB_HORZ,false);
You don't need the above lines.
bhanu_8509 wrote:
When I use Report Style, even I cannot add the items in the list
What does it mean? :confused: :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]When I use the CListCtrl using LVS_REPORT, I cannot populate the list with the items.
CString strText;
int nColumnCount = 0;
for (int i=0;i < 20;i++)
{
strText.Format(TEXT("item %d"), i);
// Insert the item, select every other item.
m_List.InsertItem(i, strText);
} -
When I use the CListCtrl using LVS_REPORT, I cannot populate the list with the items.
CString strText;
int nColumnCount = 0;
for (int i=0;i < 20;i++)
{
strText.Format(TEXT("item %d"), i);
// Insert the item, select every other item.
m_List.InsertItem(i, strText);
}I am sorry, I forget to Insert the column. Now I changed it and it is working fine. Thanks for your help.
-
When I use the CListCtrl using LVS_REPORT, I cannot populate the list with the items.
CString strText;
int nColumnCount = 0;
for (int i=0;i < 20;i++)
{
strText.Format(TEXT("item %d"), i);
// Insert the item, select every other item.
m_List.InsertItem(i, strText);
}I am sorry, I forget to Insert the column. Now I changed it and it is working fine. Thanks for your help. Topic closed...