SftOptions 1.0

SftOptions.MouseIcon Property

Softel vdm, Inc.

Defines a custom mouse icon.

Syntax       

Get

VB.NET

refPictureObj = object.MouseIcon  As System.Drawing.Image
refPictureObj = object.MouseIcon  As stdole.IPictureDisp  Note

VB

Set refPictureObj = object.MouseIcon  As IPictureDisp

C#.NET

System.Drawing.Image refPictureObj = object.MouseIcon;
stdole.IPictureDisp refPictureObj = object.MouseIcon;  Note

VC++

IPictureDisp* refPictureObj = object->GetMouseIcon();

C

HRESULT object->get_MouseIcon(IPictureDisp** refPictureObj);

Delphi

refPictureObj := object.MouseIcon  : TPicture;
refPictureObj := object.MouseIcon  : IPictureDisp;  Note

Put

VB.NET

object.let_MouseIcon(ByVal refPictureObj As stdole.IPictureDisp)  Note

VB

object.MouseIcon = refPictureObj  As IPictureDisp

C#.NET

void object.let_MouseIcon(stdole.IPictureDisp refPictureObj);  Note

VC++

void object->PutMouseIcon(IPictureDisp* refPictureObj);

C

HRESULT object->put_MouseIcon(IPictureDisp* refPictureObj);

Delphi

procedure object._Set_MouseIcon(refPictureObj : IPictureDisp);  Note

PutRef

VB.NET

object.MouseIcon = refPictureObj  As System.Drawing.Image
object.MouseIcon = refPictureObj  As stdole.IPictureDisp  Note

VB

Set object.MouseIcon = refPictureObj  As IPictureDisp

C#.NET

System.Drawing.Image object.MouseIcon = refPictureObj;
stdole.IPictureDisp object.MouseIcon = refPictureObj;  Note

VC++

void object->PutRefMouseIcon(IPictureDisp* refPictureObj);

C

HRESULT object->putref_MouseIcon(IPictureDisp* refPictureObj);

Delphi

object.MouseIcon := refPictureObj  : TPicture;
object.MouseIcon := refPictureObj  : IPictureDisp;  Note

object

A SftOptions object.

refPictureObj

Defines a custom mouse icon.  Only icons are supported.

Comments

The MouseIcon property defines a custom mouse icon.

The MouseIcon property provides a custom icon that is used when the MousePointer property is set to sftCustom (99). This mouse pointer is displayed when the cursor is located on the control.

Using PutRef (see Syntax above) the control will use the reference to the Picture object. If the Picture object is later changed, this will also affect the image used by the control. Using Put instead causes the control to create a copy of the Picture object. If the Picture object is later changed, this will not affect the image used by the control as it uses a copy of the object. Because of the additional overhead and the increased resource use of Put, PutRef is the preferred method.

Example (VB.NET)

' A picture box is used to hold the icon for the MouseIcon property. A suitable 
' icon has been defined in the picture box using its Image property.
AxSftOptions1.MouseIcon = PictureBox1.Image
AxSftOptions1.MousePointer = SftMousePointerConstants.sftCustom

Example (VB)

' A picture box is used to hold the icon for the MouseIcon property. A suitable 
' icon has been defined in the picture box using its Picture property.
Set SftOptions1.MouseIcon = Picture1.Picture
SftOptions1.MousePointer = sftCustom

Example (C#.NET)

// A picture box is used to hold the icon for the MouseIcon property. A suitable 
// icon has been defined in the picture box using its Image property.
axSftOptions1.MouseIcon = pictureBox1.Image;
axSftOptions1.MousePointer = SftMousePointerConstants.sftCustom;

Example (VC++)

PICTDESC PictDesc;
PictDesc.cbSizeofstruct = sizeof(PICTDESC);
PictDesc.picType = PICTYPE_ICON;
PictDesc.icon.hicon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_WINLOGO));
IPictureDispPtr pIPictureDisp;
HRESULT hr = OleCreatePictureIndirect(&PictDesc, IID_IPictureDisp, TRUE, (void**)&pIPictureDisp);
ASSERT(SUCCEEDED(hr));
ISftOptionsPtr vOptions = m_Options1.GetControlUnknown();
vOptions->PutRefMouseIcon(pIPictureDisp);
vOptions->MousePointer = sftCustom;

Example (Delphi)

// A TImage control is used to hold the icon for the MousePointer property. A suitable
// icon has been defined in the picture box using its Image property.
SftOptions1.MouseIcon := Image1.Picture;
SftOptions1.MousePointer := sftCustom;

See Also  SftOptions Object | Object Hierarchy


Feedback / comments / error reports for this topic
© 2002 - Softel vdm, Inc. - www.softelvdm.com