[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

filelist box

i have several files which are not totally visible in the current dimensions of the filelist box. is there a method that will allow for a hortizontal scroll bar on the filelist box or
is there some other way the user can highlight a selected file and
have the entire filename popup?
  • 2
1 Solution
Try this:
Private Const LB_ITEMFROMPOINT = &H1A9

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

Private Sub File1_MouseMove(Button As Integer, Shift As Integer, _
 X As Single, Y As Single)
    Dim lXPoint As Long
    Dim lYPoint As Long
    Dim lIndex As Long
    If Button = 0 Then ' if no button was pressed
        lXPoint = CLng(X / Screen.TwipsPerPixelX)
        lYPoint = CLng(Y / Screen.TwipsPerPixelY)
        With File1
            lIndex = SendMessage(.hwnd, LB_ITEMFROMPOINT, _
             0, ByVal ((lYPoint * 65536) + lXPoint))
            If (lIndex >= 0) And (lIndex <= .ListCount) Then
                .ToolTipText = .List(lIndex)
                .ToolTipText = ""
            End If
        End With 'File1
    End If '(button=0)
End Sub

The above answer uses the tooltip. Place the cursor on the file you want to see and the full name is displayed in the tooltip
wlionAuthor Commented:
Thanks danlevans!

I was hoping for a horizontal scroll bar, however, the tooltip is a good compromise.


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now