Drawing horizontal and vertical gridlines

来源:百度文库 编辑:神马文学网 时间:2024/04/30 03:53:41
http://www.codeguru.com/Cpp/controls/listview/gridlines/article.php/c963/
To draw horizontal and vertical gridlines we essentiallyuse the same method used for the vertical gridline or column border usedin the previous section. After drawing the vertical lines, we use GetItemRect()to get the item height and then we draw the horizontal grid lines basedon this height. One implication of using GetItemRect() is that it failswhen the list does not have any items in it and no horizontal line is drawn.Here is the complete code of the overridden OnPaint() function. Also notethat the next version of the list view control will support the LVS_EX_GRIDLINESstyle and should make our code redundant.
http://www.voicenet.com/~pgerhart/_shware.html