Copyright © 1998-2006 MultiMedia Soft 
Return to index  
 
SetPictureFromHandle method 
 
Remarks 
Changes at run-time one of the pictures associated to the button. 
 
Syntax 
Visual Basic 
control.SetPictureFromHandle (index as enumPictures, hBitmap as long) as integer 
 
Visual C++ 
BOOL control.SetPictureFromHandle (long index, OLE_HANDLE hBitmap)
 
Parameter
Description
 
 
index
Numerical value that represents the index of the picture property to change. Supported values are the following: 
Mnemonic constant
Value
Meaning
PICTURE_NORMAL
0
Changes the Picture property
PICTURE_PRESSED
1
Changes the PicturePressed property
PICTURE_MOUSEOVER
2
Changes the PictureMouseOver property
PICTURE_CUSTOM
3
Changes the PictureCustom property
PICTURE_TEXTURE
4
Changes the Texture.Filepath property
PICTURE_DISABLED
5
Changes the PictureDisabled property
hBitmap
Handle of the new bitmap to use for the selected property.
 
 
Visual Basic example 
 
BtnEnh1.SetPictureFromHandle PICTURE_NORMAL, LoadResPicture(xxx, vbResBitmap).Handle 
With this code the Picture property will be changed using a bitmap identified by xxx (contained in a .RES file). 
 
Visual C++ example 
 
HBITMAP hBitmap = LoadBitmap (hInstance, id); 
BtnEnh1.SetPictureFromHandle (PICTURE_NORMAL, (OLE_HANDLE) hBitmap); 
With this code the Picture property will be changed using a bitmap stored inside the application resources and identified by id parameter. 
 
Return value 
 
Value
Meaning
 
 
FALSE
The operation failed
TRUE
The operation was successful
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Copyright © 1998-2006 MultiMedia Soft 
Return to index