我作了一个非模态propertysheet,在上面增加了5个页面,现在想在sheet上加一个按钮,不知怎么加
解决方案 »
- 急求!用P2P技术实现广播与数据接收
- 对话框上放一个list控件,该控件窗口是CTabCtrl类型吗?
- 在按钮名称用(&字母)结尾,产生热键的原理
- 请问用API方法进行串口访问和具体的操作系统有关系吗?
- 我要设置静态文本的背景颜色和该静态文本的字体颜色,该怎样设置
- 我想要一个CSDN的离线浏览器,谁能发我一份?
- 求用delphi编写的语法分析程序,使用LL(1)分析法
- 高手请进!!有关WINDOWS 编程的问题!!!!!
- lib文件的问题?
- 小弟有个公共模块要写日志文件,可能会在多个进程空间里调用我的模块,所以需要,针对这个日志文件做互斥,处理互斥变量Mutext外,还有其
- 请Windows平台下开发高手指教!
- ip控件的问题
2、声明新增按钮的ID
#define IDC_MYBUTTON 77
3、修改CMyPropertySheet类的OnInitDialog()函数,新增部分如下:
BOOL CMyPropertySheet::OnInitDialog()
{
//...
RECT rc; GetWindowRect (&rc);
// Resize the CPropertySheet
rc.bottom += 30;
rc.left-= 90; MoveWindow (rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
// Convert to client coordinates
ScreenToClient (&rc);
// m_Button is of type CButton and is a member of CMyPropertySheet
m_Button.Create ("&MyButton", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
CRect (14, rc.bottom-30, 14+75, rc.bottom-30 + 21),
this, IDC_MYBUTTON);
//...
}4、添加消息映射
BEGIN_MESSAGE_MAP(CMyPropertySheet, CPropertySheet)
//{{AFX_MSG_MAP(CMyPropertySheet)
// NOTE - the ClassWizard will add and remove mapping macros here.
//...
ON_COMMAND(IDC_MYBUTTON, OnMyButton)
//...
//}}AFX_MSG_MAP
END_MESSAGE_MAP()5、添加OnMyButton按钮消息相应函数的声明及实现5.1、
public:
void OnMyButton();
5.2、
void CMyPropertySheet::OnMyButton ()
{
AfxMessageBox ("MyButton was clicked!");
} 可以了,祝成功!