[RESOLVED] RC6 Question: Make cWidgetBase display custom mouse-icon
We can set the custom mouse-icon for VB6-Form by setting VB6-Form.MousePointer = 99 and Set Form.MouseIcon = ImageHand.Picture. So how do I get cWidgetBase to display custom mouse-icon?
I tried cWidgetBase.MouseIconImageKey but there seems to be something wrong.
Last edited by SearchingDataOnly; May 28th, 2024 at 10:00 AM.
Re: RC6 Question: Make cWidgetBase display custom mouse-icon
Apparently the icon-loader/converter-routine of the Cairo.ImageList does not support old Ico-format with 1Bit-content.
(and I have no intention to fix that).
Though you can switch to another (greater 1Bit) *.ico-format or the much more convenient *.png or *.svg format for your MouseCursors.
If you place that in your App.Path, then the adapted Form_Load is this:
Code:
Private Sub Form_Load()
Cairo.ImageList.AddImage "Hand", "Hand.png", 32, 32
Me.BackColor = &H888888
Set Spread = ucPanel1.Widgets.Add(New cwSpread, "Spread")
Spread.Widget.MouseIconImageKey = "Hand,12,4"
End Sub
Note the difference in the StringKey-formats for "a normal, regular ImageKey" (as given in the .AddImage-method) -
and the "ImageKey with additional comma-separated values" in the MouseIconImageKey-assignment.
The latter format allows a string-based HotSpot-definition (via such Comma-appendices).
One can read a bit more about that in Demo-Folder: 4 Widgets (MouseCursors and ImageKeys)
of the Widget-Tutorial: https://www.vbforums.com/showthread....dgets-Tutorial
Edit: Forgot to mention (in case it is really only about the "Hand-Cursor") - that a simple:
Spread.Widget.MousePointer = IDC_HAND
...would be enough (no loading or assignment of external ImageResources needed)...
HTH
Olaf
Last edited by Schmidt; May 28th, 2024 at 12:33 PM.