Click to See Complete Forum and Search --> : Scroll Bar
Technocrat
Feb 27th, 2001, 03:02 PM
I need some help and code with scroll bars using CreateWindowEX. How do I get them to appear? Is there a message I need to catch? How do I make them scroll?
Thanks
Make them appear?? Just use the ShowWindow function, or when creating them, set their style to WS_VISIBLE.
Technocrat
Feb 27th, 2001, 04:03 PM
They dont.
m_hWnd_MsgList = CreateWindowEx(WS_EX_NOPARENTNOTIFY, "SysListView32", NULL, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LVS_REPORT| WS_VSCROLL | WS_HSCROLL | WS_CLIPSIBLINGS , 0, 0, 300, 100,hWnd, NULL, m_hInst, NULL);
ListView_SetExtendedListViewStyle(m_hWnd_MsgList, LVS_EX_FULLROWSELECT);
//Shows The Window The ListView Is In
ShowWindow(hWnd,SW_SHOWNORMAL);
UpdateWindow(hWnd);
ShowWindow(m_hWnd_MsgList,SW_SHOWNORMAL);
UpdateWindow(m_hWnd_MsgList);
Change the class name to "ScrollBar"
Technocrat
Feb 28th, 2001, 11:28 AM
Do you mean add another CreateWindowEX for the scroll bars? Because if I rename it then I would lose my ListView.
Jop
Mar 2nd, 2001, 08:28 AM
Well, when I create a listview I use:
m_hWndListCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL, WS_CHILD|WS_VISIBLE|LVS_SHAREIMAGELISTS|WS_TABSTOP|LVS_REPORT|LVS_AUTOARRANGE, 0, 0, 0, 0, m_hWnd, (HMENU)ID_LISTVIEW, g_hInstance, NULL);
In conjunction with InitCommonControlsEx and the needed libraries and includes (something like comctrl.h and .lib)
the listview displays the scrollbars automaticly when there has to be one
Technocrat
Mar 2nd, 2001, 09:46 AM
There was, after many hours of screaming ***, I figured out that the listview view area was to big and the scroll bars were out side the window.
Thanks for all the help
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.