上一篇 | 下一篇

CCheckStatic类

发布: 2008-6-26 13:34 | 作者: admin | 来源: | 查看: 0次

下载本文所附源代码

程序运行效果截图:

运行环境:VC 4-6, Win98, NT4, W2K, MFC

类使用方法:

在对话框中放置一个static box控件。把static box控件声明为CCheckStatic类型的成员变量。这样在static box控件的顶部的左侧就会自动出现一个复选框了。这时选中/不选中这个复选框,控件里面的所有控件将正常/变灰显示。我说的是自动,但是你不要忘记在OnInitDialog中调用Init()方法。

下面是CCheckStatic类的方法列表:

void Init(); // Though shalt always call this before using my class.

int AddItem(int ID); // Adds a control to the custom list

void ClearItems(); // Empties the custom list

void SetCheck(BOOL check); // Sets the check state and toggles dialog items

字号: | 推荐给好友

评分:0

我来说两句