Results 1 to 5 of 5

Thread: [RESOLVED] Issue with tooltip class

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2024
    Posts
    67

    Resolved [RESOLVED] Issue with tooltip class

    Hi all,

    I'm trying twinbasic and have everything declared and the app loads and runs, which is great.

    There is a problem though with a form that contains a combobox of suppliers. This combo uses a class to create a tooltip capable of showing multiple lines and is used to show the supplier's address.

    When the form loads the first time it all works, but subsequent loads give the error Run-time error 91 (0000005B) Object variable or With bock variable not set.
    This is in the Load event
    Code:
        Set mclsToolTip = New clsToolTip
        With mclsToolTip
            Call .Create(Me)
            .MaxTipWidth = 240
            .DelayTime(ttDelayShow) = 20000
            Call .AddTool(cmbSupplier)
        End With
    The error occurs when setting the property to anything
    Code:
     mclsToolTip.ToolText(cmbSupplier) = "No address"
    The unload event
    Code:
        Private Sub Form_Unload(Cancel As Integer)
        On Error Resume Next
        Call mclsToolTip.RemoveTool(cmbSupplier)
        Set mclsToolTip = Nothing
        End Sub
    mclsTooTip is quite long, so I haven't posted it, but I can do if useful.

  2. #2
    Hyperactive Member
    Join Date
    Dec 2020
    Posts
    273

    Re: Issue with tooltip class

    Could you provide a small example project to demonstrate the issue? Cleanup when unloading/reloading a form is generally a lot better than it used to be, but there could certainly still be some edge cases.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2024
    Posts
    67

    Re: Issue with tooltip class

    I set one up, but annoyingly the error didn't occur there. I seem to be able to get round it by checking whether mclsToolTip is nothing and if so reinitialising it.

  4. #4
    Hyperactive Member
    Join Date
    Dec 2020
    Posts
    273

    Re: Issue with tooltip class

    BTW, I forgot to mention that ToolTipText in twinBASIC supports multi-line text (both in IDE and at runtime)

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2024
    Posts
    67

    Re: Issue with tooltip class

    Fantastic

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