|
-
April 23rd, 2009, 04:48 AM
#1
Help Needed - How to draw Gridlines in ListBox (Non MFC) Win32
Hi all.. i'm having a problem with the Listbox control in a Window. I need to display Gridlines(Horizontical lines) in the listbox control.
I Searched the MSDN Documentation and found that, the LVS_EX_GRIDLINES style setting can do it for me.. and also, it must be used in conjunction with LVS_REPORT style.
I tried, but was in vein.. nothing happened.. i used the ListView_SetExtendedStyleView() API and also tried out using the SendMessage() API... And that too failed.
I searched google for sample codes, but didnt find any useful.. there are soo many codes and articles on MFC, but i dont know MFC.. i need only Win32 code.
I will post my code snippet here..
Code:
icce.dwSize = sizeof(icce);
icce.dwICC = ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&icce);
hList = CreateWindowEx(WS_EX_CLIENTEDGE,"listbox","MyListBox...",WS_CHILD|WS_VISIBLE|LVS_REPORT ,5,40,480,290,appWindow, (HMENU)1003,hInst,(LPVOID)lpParam);
ListView_SetExtendedListViewStyleEx(hList, LVS_EX_GRIDLINES, LVS_EX_GRIDLINES);
Now, whats wrong with the code, where am i err-ing?
I use this code inside a function named RenderList() and calls it from the WM_CREATE message handler of the Main window(Parent) hWnd.
I will apreciate all your valuable inputs..
Thanks in advance, and i'll vote you for sure if you helps me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|