Tabbed Documents icon on captionbar (1 Viewer)

raphael99

Registered User.
Local time
Today, 04:39
Joined
Apr 6, 2015
Messages
126
Customizing the form with the following code
Code:
Public Declare Function LoadImage Lib "user32" _
Alias "LoadImageA" _
(ByVal hInst As Long, _
ByVal lpsz As String, _
ByVal un1 As Long, _
ByVal n1 As Long, _
ByVal n2 As Long, _
ByVal un2 As Long) _
As Long

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 Const LR_LOADFROMFILE = &H10
Public Const IMAGE_BITMAP = 0
Public Const IMAGE_ICON = 1
Public Const WM_SETICON = &H80

Public Function ImpostaCaptionBarImage(hWnd As Long, IconPath As String) As Boolean
Dim IcohWnd As Long

 IcohWnd = LoadImage(0&, IconPath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE)

If IcohWnd <> 0 Then
Call SendMessage(hWnd, WM_SETICON, 0, ByVal IcohWnd)
ImpostaCaptionBarImage = True
End If
End Function
And OnLoad form:
Code:
Call ImpostaCaptionBarImage(Me.hWnd, "C:\Path\Login.ico")

I can load the little icon on the left on CaptionBar.
It works very well on overlapping mode but no on Tabbed documents. How to works with tabbed documents mode?
Thanks
 

vbaInet

AWF VIP
Local time
Today, 12:39
Joined
Jan 22, 2010
Messages
26,374
Why don't you use this? See attached screenshot.
 

Attachments

  • Form icons.png
    Form icons.png
    13.8 KB · Views: 96

raphael99

Registered User.
Local time
Today, 04:39
Joined
Apr 6, 2015
Messages
126
I use it. It was for a better customization. One icon to one form. But I think that 's not possible to customize more than this
 

vbaInet

AWF VIP
Local time
Today, 12:39
Joined
Jan 22, 2010
Messages
26,374
Alright, I see. How does it show when it's tabbed? Let me see a screenshot.

Perhaps you need to add that code to the Got Focus event of the form.
 

raphael99

Registered User.
Local time
Today, 04:39
Joined
Apr 6, 2015
Messages
126
tabbed.jpg

Here it is,
No also in GOT Focus icon does not change
 

vbaInet

AWF VIP
Local time
Today, 12:39
Joined
Jan 22, 2010
Messages
26,374
It doesn't look like that's possible. If the form is a Popup form it works ok regardless of what the Tabbed Documents setting is.
 

raphael99

Registered User.
Local time
Today, 04:39
Joined
Apr 6, 2015
Messages
126
I got an access 2003 based commercial software that does it. I wonder how... :((
 

vbaInet

AWF VIP
Local time
Today, 12:39
Joined
Jan 22, 2010
Messages
26,374
2003 doesn't have the Tabbed Documents option, that was introduced in 2007. What I'm saying is that once a form or report is grouped as a tab the icon can't be any different from the application icon. As soon as it's not grouped, like having it as a popup, it can be changed.
 

raphael99

Registered User.
Local time
Today, 04:39
Joined
Apr 6, 2015
Messages
126
Infact on popup modal form it works. But not on tabbed. I will go deeply in this question.
Anyway maybe the application I got is based on 2007. It has tabs
 

vbaInet

AWF VIP
Local time
Today, 12:39
Joined
Jan 22, 2010
Messages
26,374
Infact on popup modal form it works. But not on tabbed.
That's precisely what I explained in the last two posts.

It would appear that Access changes the way it handles tabbed forms in this instance.
 

mrrcomp

Registered User.
Local time
Today, 14:39
Joined
May 3, 2010
Messages
16
That's precisely what I explained in the last two posts.

It would appear that Access changes the way it handles tabbed forms in this instance.

Did anyone get this working in Tabbed Documents Access 2016 64Bit
 

Users who are viewing this thread

Top Bottom