现在的位置: 首页 > 综合 > 正文

How to disable Toolbar button?

2013年10月22日 ⁄ 综合 ⁄ 共 346字 ⁄ 字号 评论关闭

MFC has an unobvious way to do this. Create a BOOL member variable that
holds the enable/disable desired state. When you want to change the
state you set the variable, but do not call any toolbar function.

Add a message handler for the UPDATE_COMMAND_UI message from the button.
  In your message handler function call pCmdUI->Enable(m_bYourVariable);
  MFC calls this function periodically during idle time.

【上篇】
【下篇】

抱歉!评论已关闭.