Defines the second graphic.
Get
| C# | SftPictureObject refImageObj = object.Image2; |
| VB.NET | refImageObj = object.Image2 As SftPictureObject |
| C++ | ISftPictureObject* refImageObj = object->Image2; ISftPictureObject* refImageObj = object->GetImage2(); |
| C | HRESULT object->get_Image2(ISftPictureObject** refImageObj); |
| VB | Set refImageObj = object.Image2 As SftPictureObject |
Put
| C# | SftPictureObject object.Image2 = refImageObj; |
| VB.NET | object.Image2 = refImageObj As SftPictureObject |
| C++ | ISftPictureObject* object->Image2 = refImageObj; void object->PutImage2(ISftPictureObject* refImageObj); |
| C | HRESULT object->put_Image2(ISftPictureObject* refImageObj); |
| VB | object.Image2 = refImageObj As SftPictureObject |
object
refImageObj
Defines the second graphic.
The Image2 property defines the second graphic.
The Image2Hover property is used if the mouse cursor is located on the control or picture component, Image2Pressed is used if the button is pressed or Image2Disabled is used if the control is disabled (see Enabled property). Otherwise, the Image2 property is used to display the second graphic. Image2Hover, Image2Pressed and Image2Disabled are ignored if no graphic has been defined using the Image2 property.
The layout of the button label and the position and alignment of the second picture component are defined using the Orientation, Image2AlignHorz and Image2AlignVert properties.
For detailed information on the use of the Orientation, Image1, Image1AlignHorz, Image1AlignVert, Image2, Image2AlignHorz, Image2AlignVert, Text, TextAlignHorz, TextAlignVert properties, please see "Button Label".
}
private void ChangePicture_Button3()
{
// Change the pictures based on the button's Pressed status
if (axSftButton3.Pressed)
{
axSftButton3.Image1.NETImageObject = imageList1.Images[1];
axSftButton3.Image2.NETImageObject = imageList1.Images[0];
} else {
axSftButton3.Image1.NETImageObject = imageList1.Images[0];
axSftButton3.Image2.NETImageObject = imageList1.Images[1];
}
}
private void axSftButton3_ClickEvent(object sender, System.EventArgs e)Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click Application.Exit() End Sub Private Sub ChangePicture_Button3() ' Change the pictures based on the button's Pressed status If AxSftButton3.Pressed Then AxSftButton3.Image1.NETImageObject = ImageList1.Images(1) AxSftButton3.Image2.NETImageObject = ImageList1.Images(0) Else AxSftButton3.Image1.NETImageObject = ImageList1.Images(0) AxSftButton3.Image2.NETImageObject = ImageList1.Images(1) End If End Sub Private Sub axSftButton3_ClickEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxSftButton3.ClickEvent
bmp.LoadBitmap(IDB_ON);
pictDesc.bmp.hbitmap = (HBITMAP) bmp.m_hObject;
hr = ::OleCreatePictureIndirect(&pictDesc, IID_IPicture, TRUE, (void**)&pPic);
ASSERT(SUCCEEDED(hr));
if (FAILED(hr)) return;
ISftPictureObjectPtr pImg2;
hr = m_vButton3->get_Image2(&pImg2);
ASSERT(SUCCEEDED(hr));
pPicDisp = pPic;
hr = pImg2->put_Picture(pPicDisp);
ASSERT(SUCCEEDED(hr));
}
End With
End Sub
Private Sub ChangePicture_SftButton3()
' Change the pictures based on the button's Pressed status
With SftButton3
If .Pressed Then
Set .Image1.Picture = PictureOn.Picture
Set .Image2.Picture = PictureOff.Picture
Else
Set .Image1.Picture = PictureOff.Picture
Set .Image2.Picture = PictureOn.Picture
End If
End With
End Sub
See Also SftButton Object | Object Hierarchy