-
Mar 25th, 2025, 07:24 AM
#1
Thread Starter
Lively Member
[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.
-
Mar 25th, 2025, 10:40 AM
#2
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.
-
Mar 25th, 2025, 11:36 AM
#3
Thread Starter
Lively Member
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.
-
Mar 25th, 2025, 01:38 PM
#4
Re: Issue with tooltip class
BTW, I forgot to mention that ToolTipText in twinBASIC supports multi-line text (both in IDE and at runtime)
-
Mar 26th, 2025, 04:49 AM
#5
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|