Putting grids line in ListCtrl.

I try to add gridlines to the ListCtrl by modifying the ex-style using ModifyStyleEx in the InilDialog function to add LVS_EX_GRIDLINES to the LisCtrl control, it does not work. I checked the comctrl.dll it is the right version.
What could be wrong?
hshliangAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PIGCommented:
Use  SetExtendedStyle
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
akalmaniCommented:
Hi !!
   hope it helps u out ?

Try this
call this in oninitialupdate or oninitdialog if it is a view or dialog

ListView_SetExtendedListViewStyle(m_List,LVS_EX_GRIDLINES);

where m_List is a member variable of ListCtrl.
0
PIGCommented:
AKALMANI, it is same. But don't work with comctl32.dll in all version. I don't now why. I am trying with comctl32.dll version 4.72.3110.8 and here work't. :-(
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

akalmaniCommented:
Hope this helps u out ?

Use this function in OninitialUpdate or Oninitdialog ..
ListView_SetExtendedListViewStyle(m_List,LVS_EX_GRIDLINES);
 where m_List is the member variable of ListCtrl.
0
PIGCommented:
Yes, but efects is some. Macros ListView_SetExtendedListViewStyle and SetExtendedStyle make equally work. And two send message LVM_SETEXTENDEDLISTVIEWSTYLE explicitly. No more, no less.
0
hshliangAuthor Commented:
Thank you, it is my oversight, it is mentioned in the info of LVS_EX_GRIDLINES that I should use SetExtStyle. But can I ask why do I have to use something different from he usual ModifyStyleEx, and why doesn't ModifyStyelEx work???
0
PIGCommented:
Extendet styles for ListCtrl is one and extendet style for window (ModifyStyelEx modified them) is another. ListCtrl is special windwos control and hers extendet styles can modified only with special funstion. All code for these controls, not only ListCtrl is in comctrl32.dll. And all communcations with their message map is not to easy.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.