HeaderPane
Main
Hide
Share Link
Print

MouseIcon Property, SftButton Object

Defines a custom mouse icon.

Syntax

Get

C#System.Drawing.Image refPictureObj = object.MouseIcon;
VB.NETrefPictureObj = object.MouseIcon As System.Drawing.Image
C++IPictureDisp* refPictureObj = object->GetMouseIcon();
CHRESULT object->get_MouseIcon(IPictureDisp** refPictureObj);
VBSet refPictureObj = object.MouseIcon As IPictureDisp

Put

C#void object.let_MouseIcon(System.Drawing.Image refPictureObj);
VB.NETobject.let_MouseIcon(ByVal refPictureObj As System.Drawing.Image)
C++void object->PutMouseIcon(IPictureDisp* refPictureObj);
CHRESULT object->put_MouseIcon(IPictureDisp* refPictureObj);
VBobject.MouseIcon = refPictureObj As IPictureDisp

PutRef

C#System.Drawing.Image object.MouseIcon = refPictureObj;
VB.NETobject.MouseIcon = refPictureObj As System.Drawing.Image
C++void object->PutRefMouseIcon(IPictureDisp* refPictureObj);
CHRESULT object->putref_MouseIcon(IPictureDisp* refPictureObj);
VBSet object.MouseIcon = refPictureObj As IPictureDisp

object

A SftButton object.

refPictureObj

Defines a custom mouse icon. This icon contains the graphic used as the custom mouse icon. This icon handle has to remain valid until the control no longer uses it. For information about picture properties, please visit the applicable section "Using SftButton/OCX with ...".

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 anywhere on the control.

The MouseIcon and MouseIconH properties are synonyms, but accept different value types (Picture object reference or Windows icon handle).

Even though the class wrapper generated by Visual Studio for .NET applications (C#, VB.NET) includes the MouseIcon property, it is not usable as the System.Drawing.Image type does not support icons. For managed .NET applications the MouseIconH property must be used instead by assigning an icon's handle to the MouseIconH property as in

axSftButton1.MouseIconH = (int)icon1.Handle;

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.

See Also SftButton Object | Object Hierarchy


Last Updated 11/03/2026 - (email)
© 2026 Softel vdm, Inc.