Help Center

CButton.SetImagemethod

Associates a new image (icon or bitmap) with the button.

WindowsmethodCButton.incdocumented

Syntax

FUNCTION SetImage (BYVAL hButton AS HWND, BYVAL ImageType AS DWORD, BYVAL hImage AS HANDLE) AS HANDLE

Parameters

NameDescription
hButtonThe handle of the button control.
ImageTypeThe type of image to delete. This parameter can be one of the following values (se below):
hImageHandle of the icon or bitmap.

Return value

The return value is a handle to the image (icon or bitmap) previously associated with the button, if any; otherwise, it is NULL.

Description

Associates a new image (icon or bitmap) with the button. The return value is a handle to the image previously associated with the button, if any; otherwise, it is NULL.

Example

CButton.SetImage(hButton, IMAGE_BITMAP, hBmp) CButton.SetImage(hButton, IMAGE_ICON, hIcon)

Reference

  • Include file CButton.inc
  • Defined in AfxNova/CButton.inc:162
  • Documented in Windows/WIndows Controls/CButton Class.md
  • Topic: CButton Class