Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

showing tooltip from dotnet dll in vb6

Status
Not open for further replies.

imjbhowe

IS-IT--Management
Jul 26, 2001
18
0
0
US
I have a dotnet usercontrol that I embed in vb6 (the main application is vb6). I have it working fine except for one thing. My tooltips do not display when I run the control in vb6. Everything works fine in dotnet.

I am using the basic tooltip1.settooltip(controlname, tooltiptext).

I have changed tooltip1 to be "Public" instead of "Friend" and I have set the "Show Always" flag to true but it doesn't seem to make any difference.

In vb6 I am adding the control via:

Private with events ctrl as vbcontrolextender

I have searched all over to no avail.

Any help is appreciated
 
'In a solution .......................................... (named StaBut)
'In a usercontrol ....................................... (named ctlStaBut)
'Choose a Tooltip control in the toolbox ................ (tltStaBut)
'...
'To have a tooltip when the mouse goes over a control ... (picStaBut)

Public Class ctlStaBut
Inherits System.Windows.Forms.UserControl
Implements IButtonControl
...
Public Sub New()
MyBase.New()
InitializeComponent()
...
Private tltTxt As String
Private shwTlt As Boolean
tltTxt = "Try this..."
shwTlt = True
End Sub

#Region " Properties -------------------------------------------------------- "
'...
Public Property SetTltText() As String
Get
Return tltTxt
End Get
Set(ByVal Value As String)
tltTxt = Value
Invalidate()
End Set
End Property

<System.ComponentModel.DefaultValue(True)> _
Public Property ToolTipActive() As Boolean
Get
Return shwTlt
End Get
Set(ByVal Value As Boolean)
shwTlt = Value
Invalidate()
End Set
End Property
'...
#End Region

Private Sub SetMseOver()
'...
'Set up the delays for the ToolTip.
If shwTlt Then
' AutoPopDelay property determines the length of time the ToolTip string is shown.
'tltStaBut.AutoPopDelay = 100
' The InitialDelay property determines how long the user must point at the
' associated control for the ToolTip string to appear.
tltStaBut.InitialDelay = 20000
' The ReshowDelay property sets the number of milliseconds it takes for subsequent ToolTip strings to appear as the mouse moves from one ToolTip-associated control to another.
tltStaBut.ReshowDelay = 0
' Force the ToolTip text to be displayed whether or not the form is active.
tltStaBut.ShowAlways = False
' Set up the ToolTip text.
tltStaBut.SetToolTip(picStaBut, tltTxt)
End If
'...
End Sub
End Class

'--------------------------------------------------------------------------
Public Class Form1
Inherits System.Windows.Forms.Form
'...
'...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim stBu1 As New StaBut1.ctlStaBut()
'...
Me.Controls.Add(stBu1)
stBu1.SetTltText = &quot;I have found it...&quot;
stBu1.ToolTipActive = True
End Sub
'...
End Class

'I hope you can do something with this... Let me know...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top