|
-
Apr 29th, 2003, 06:55 AM
#1
Toolbar tooltips under the form...
VB Code:
Option Explicit
Private Declare Function ExtractFileIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, _
ByVal lpIconPath As String, _
lpiIcon As Long) _
As Long
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal hIcon As Long) _
As Long
Private Sub Toolbar1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
Dim p As Long
Dim i As Long
Dim tb As MSComctlLib.Button
If Data.GetFormat(vbCFFiles) Then
For p = 1 To Data.Files.Count
i = GetILIconIndex(Data.Files(p))
Set tb = Toolbar1.Buttons.Add(, , "", , i)
tb.ToolTipText = Data.Files(p)
Next
End If
Set tb = Nothing
End Sub
Private Function GetILIconIndex(ByVal sFile As String) As Long
Dim hIcon As Long
Dim li As ListImage
Picture1.Picture = LoadPicture
hIcon = ExtractFileIcon(App.hInstance, sFile, 0&)
If hIcon Then
Call DrawIcon(Picture1.hdc, 0, 0, hIcon)
End If
Picture1.Picture = Picture1.Image
Set li = ImageList1.ListImages.Add(, , Picture1.Picture)
GetILIconIndex = li.Index
Picture1.Picture = LoadPicture
Set li = Nothing
End Function
I'm basically using this code to allow for file shorcuts on a toolbar. The problem is that the tooltips for the buttons seem to be showing up underneath the toolbar's parent form. Any idea why this would be happening?
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 8th, 2010, 08:28 AM
#2
New Member
Re: Toolbar tooltips under the form...
Did you ever find a solution for this? I have a similar issue with a home-grown OCX. When it's loaded into a specific host application, which is set to "Always on Top" the tooltips for my OCX show up behind the host application. If "Always on Top" is disabled the tooltips show up properly.
Eric
-
Apr 8th, 2010, 10:15 AM
#3
Re: Toolbar tooltips under the form...
edqilson97, welcome to the forums. You shouldn't bump old threads. This one is 7 years old. You can either ask the user via PM, or create a new thread and post your question.
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
|