SetPictureFromHandle method
Remarks
Changes at runtime one of the pictures associated to the button.
Syntax
Syntax
[Visual Basic]
Public Function SetPictureFromHandle(nPicture as Ctl3d.Pictures, hBitmap as Integer) as Bool
[C#]
public bool SetPictureFromHandle(Ctl3d.Pictures nPicture, long hBitmap);
[C++]
public: bool SetPictureFromHandle(Ctl3d.Pictures nPicture, long hBitmap);
|
Parameter
|
Description
|
|
|
|
|
nPicture
|
Value that represents the index of the picture property to change. Supported values are the following:
|
Enumerated value
|
Value
|
Meaning
|
|
Pictures.Normal
|
0
|
|
|
Pictures.Pressed
|
1
|
|
|
Pictures.MouseOver
|
2
|
|
|
Pictures.Custom
|
3
|
|
|
Pictures.Texture
|
4
|
|
|
Pictures.Disabled
|
5
|
|
|
|
hBitmap
|
Handle of the new bitmap to use for the selected property.
|
Visual C# example
System.Drawing.Bitmap bmp = (System.Drawing.Bitmap) pictureBox1.Image;
ctl3dPushButton1.SetPictureFromHandle (Pictures.Normal, (int) bmp.GetHbitmap ().ToInt32 ());
With this code the
Picture property of control
ctl3dPushButton1 will be changed using a bitmap obtained from the image contained inside a picture box control.
Return value
|
Value
|
Meaning
|
|
|
|
|
False
|
The operation failed
|
|
True
|
The operation was successful
|