位图按钮
2008-02-28 20:29
92 查看
如果需要在按钮中显示图标或位图,您可以用BS_ICON或BS_BITMAP风格,并用BM_SETIMAGE消息设置位图,对于BS_OWNERDRAW风格的按钮,它允许完全自由地绘制按钮。
BM_SETIMAGE
An application sends a BM_SETIMAGE message to associate a new image (icon or bitmap) with the button.
To send this message, call the SendMessage function with the following parameters.
SendMessage(
(HWND) hWnd, // handle to destination window
BM_SETIMAGE, // message to send
(WPARAM) wParam, // image type
(LPARAM) lParam // handle to the image (HANDLE)
);
Parameters
wParam
Specifies the type of image to associate with the button. This parameter can be one of the following values:
IMAGE_BITMAP
IMAGE_ICON
lParam
Handle to the image to associate with the button.
Return Values
The return value is a handle to the image previously associated with the button, if any; otherwise, it is NULL.
Remarks
Requirements
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winuser.h; include Windows.h.
See Also
Buttons Overview, Button Messages, BM_GETIMAGE
BM_SETIMAGE
An application sends a BM_SETIMAGE message to associate a new image (icon or bitmap) with the button.
To send this message, call the SendMessage function with the following parameters.
SendMessage(
(HWND) hWnd, // handle to destination window
BM_SETIMAGE, // message to send
(WPARAM) wParam, // image type
(LPARAM) lParam // handle to the image (HANDLE)
);
Parameters
wParam
Specifies the type of image to associate with the button. This parameter can be one of the following values:
IMAGE_BITMAP
IMAGE_ICON
lParam
Handle to the image to associate with the button.
Return Values
The return value is a handle to the image previously associated with the button, if any; otherwise, it is NULL.
Remarks
Requirements
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winuser.h; include Windows.h.
See Also
Buttons Overview, Button Messages, BM_GETIMAGE
相关文章推荐
- MFC添加位图按钮,MFC添加图标按钮
- 位图按钮的实现方法
- 利用CBitmapButton类实现位图按钮的两种方法
- 按钮加载位图的几个方法 vc
- 动态改变工具条中按钮的位图
- Visual C++中位图按钮的新颖设计
- 用AutoLoad显示位图按钮
- 用VC创建图标,位图按钮
- VC位图按钮相关实现方法总结
- 利用CBitmapButton类实现位图按钮的方法
- WINCE位图按钮切换闪烁的问题解决方法
- 有关MFC中使用CButton类后位图按钮闪烁的问题
- 利用CBitmapButton类实现位图按钮的两种方法
- VC使用位图和图标制作按钮
- 利用CBitmapButton类实现位图按钮的两种方法
- 利用CBitmapButton类实现位图按钮的两种方法
- 按钮中添加位图和图标
- mfc 在原有的按钮上添加位图
- VC 位图按钮CBitmapButton的使用
- 怎样修改windows里的开始按钮的位图?