Link to home
Start Free TrialLog in
Avatar of hshliang
hshliang

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of PIG
PIG

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of akalmani
akalmani

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.
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. :-(
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.
Yes, but efects is some. Macros ListView_SetExtendedListViewStyle and SetExtendedStyle make equally work. And two send message LVM_SETEXTENDEDLISTVIEWSTYLE explicitly. No more, no less.
Avatar of hshliang

ASKER

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???
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.