Results 1 to 3 of 3

Thread: [RESOLVED] RC6 Question: Make cWidgetBase display custom mouse-icon

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,685

    Resolved [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.
    Attached Files Attached Files
    Last edited by SearchingDataOnly; May 28th, 2024 at 10:00 AM.

  2. #2
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,441

    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.

    I've uploaded a Hand.png file you can try, here: https://vbRichClient.com/Downloads/Hand.png

    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.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,685

    Re: RC6 Question: Make cWidgetBase display custom mouse-icon

    I see. Thank you, Olaf.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width