Iocomp控件教程之Percent Bar——百分比工具条控件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Cracent/article/details/51171425

Percent Bar——百分比工具条控件(Percent Bar)以百分比形式显示每个项目内容所占的百分比比重。在设计时,可以用属性编辑器来添加和移除项目以及更改属性值。在运行时间,使用AddItem,RemoveItem, ClearListItemCount用于添加或移除项目;使用ItemTitle, ItemColor ItemValue来更改属性值。LegendShowValue LegendShowPercent属性用于隐藏某个项目内容的图标符号和百分比数值

第一步:建立MFC对话框

第二步:插入ActiveX控件---Percent Bar控件

 

第三步:单击控件-鼠标右键-添加成员变量

 

可以通过修改属性获得不同的效果

主要函数介绍:(顾名思义,不再文字赘述)

voidSetItemTitle(longIndex, LPCTSTRTitle)

voidSetItemColor(longIndex, unsigned long Color)

voidSetItemValue(longIndex, double Value)

voidput_LegendShowPercent(BOOLnewValue)

voidput_LegendValuePrecision(longnewValue)

voidput_LegendShowValue(BOOLnewValue)

voidAddItem(LPCTSTRTitle, unsigned long Color, doubleValue)

voidRemoveItem(longIndex)

voidClearList()

猜你喜欢

转载自blog.csdn.net/Cracent/article/details/51171425