VC如何实现工具栏按钮的状态
按下是一个样子比如凹下去或者换个别的颜色也行,再点击一下弹起来恢复按下前的样子;是在代码里面添加还是只在资源里面做改动,麻烦说详细点...
按下是一个样子 比如凹下去或者换个别的颜色也行,再点击一下弹起来恢复按下前的样子;是在代码里面添加还是只在资源里面做改动,麻烦说详细点
展开
2个回答
展开全部
用SendMessage给工具栏控件发送消息:TB_SETSTATE
wParam = (WPARAM) idButton;
lParam = (LPARAM)MAKELONG(fState,0);
//按钮的状态可以是:
//TBSTATE_ENABLED,没有这个state,按钮是灰化的
//TBSTATE_CHECKED The button has the TBSTYLE_CHECK style and is being clicked.
//TBSTATE_ELLIPSES Version 4.70. The button's text is cut off and an ellipsis is displayed.
//TBSTATE_HIDDEN,隐藏的
//TBSTATE_INDETERMINATE,灰化的
//TBSTATE_MARKED Version 4.71.遮罩
//TBSTATE_PRESSED,按下
//TBSTATE_WRAP 必须有TBSTATE_ENABLED状态
wParam = (WPARAM) idButton;
lParam = (LPARAM)MAKELONG(fState,0);
//按钮的状态可以是:
//TBSTATE_ENABLED,没有这个state,按钮是灰化的
//TBSTATE_CHECKED The button has the TBSTYLE_CHECK style and is being clicked.
//TBSTATE_ELLIPSES Version 4.70. The button's text is cut off and an ellipsis is displayed.
//TBSTATE_HIDDEN,隐藏的
//TBSTATE_INDETERMINATE,灰化的
//TBSTATE_MARKED Version 4.71.遮罩
//TBSTATE_PRESSED,按下
//TBSTATE_WRAP 必须有TBSTATE_ENABLED状态
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询