• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

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?
0
hshliang
Asked:
hshliang
  • 4
  • 2
1 Solution
 
PIGCommented:
Use  SetExtendedStyle
0
 
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
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now