Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Tooltip

Posted on 1998-09-13
2
Medium Priority
?
139 Views
Last Modified: 2010-04-30
Hello,
On a listbox or combobox, I would like than a tooltiptext appears when the text is not completly visible.
How can I do this?
Thanks a lot
Nathalie
0
Comment
Question by:sidjey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Expert Comment

by:sen999
ID: 1434593
Have a label which will be invisible by default. whenever needed you make it visible true and set the left and top properties approriately. So that it will appear as a tool tip
0
 

Accepted Solution

by:
kambhampati earned 0 total points
ID: 1434594
hello sidjey ,
u use this code,  place a listbox on a form with name list1

'Module level declaration

Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function SendMessageLong Lib _
    "user32" Alias "SendMessageA" _
    (ByVal hwnd As Long, _
     ByVal wMsg As Long, _
     ByVal wParam As Long, _
     ByVal lParam As Long) As Long

Public Const EM_LINEFROMCHAR = &HC9
Public Const EM_GETLINECOUNT = &HBA
Public Function ListTips(Button As Integer, Shift As Integer, X As Single, Y As Single, List1 As ListBox) As String
        Dim lXPoint As Long
        Dim lYPoint As Long
        Dim lIndex As Long
        If Button = 0 Then
            lXPoint = CLng(X / Screen.TwipsPerPixelX)
            lYPoint = CLng(Y / Screen.TwipsPerPixelY)
            With List1
                lIndex = SendMessage(.hwnd, 425, 0, ByVal ((lYPoint * 65536) + lXPoint))
                If (lIndex >= 0) And (lIndex <= .ListCount) Then
                    .ToolTipText = .List(lIndex)
                Else
                    .ToolTipText = ""
                End If
            End With
        End If
    End Function
'''



'Paste this in list1_mousemove event




Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
       ListTips Button, Shift, X, Y, List1
    End Sub

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question