拖一个ListView到窗体上,
双击ListView控件,
在弹出的项目编辑器中添加如下四个列表项,
四个列表项的标题和图标分别为:
通知公告![]()
监督管理![]()
产品检测![]()
监管对象![]()
(示例1%20基本功能).files/image010.jpg)
目前效果如下图所示:
(示例1%20基本功能).files/image012.jpg)
接下来把ViewType设置为lvtIcon,
表示使用图标显示模式,
把ItemHeight设置为80,
ItemWidth设置为106,
(示例1%20基本功能).files/image014.jpg)
接下来设置图标,让图标缩小并水平居中显示,
把DrawItemIconParam.IsAutoFit设置为True,
把DrawItemIconParam.PicureHorzAlign设置为phaCenter,
把DrawItemIconParam.PictureVertAlign设置为pvaTop,
再展开DrawItemIconParam.DrawRectSetting,
把DrawRectSetting.Enabled设置为True,
DrawRectSetting.PositionHorzType设置为dpphtCenter,
DrawRectSetting.SizeType设置为dpstPercent,
DrawRectSetting.Top设置为10,
DrawRectSetting.Height设置为65,
(示例1%20基本功能).files/image016.jpg)
(示例1%20基本功能).files/image018.jpg)
再把标题的字体设置成水平居中,垂直向下,
DrawItemCaptionParam.FontHorzAlign设置为fhaCenter,
DrawItemCaptionParam.FontVertAlign设置为fvaBottom,
(示例1%20基本功能).files/image020.jpg)
(示例1%20基本功能).files/image022.jpg)