Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
is there a way i can put a icon in the blue bar next to the userform name?
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
i don't think so. i think it violates the naming conviction. but if you have it saved as an image, you can put it on the form. see the form's picture property on the form's property sheet. Regards FSt1 "pswanie" wrote: is there a way i can put a icon in the blue bar next to the userform name? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
need it to show in the "blue" bar
It does with me. Could you post your code. RBS "pswanie" wrote in message ... Thanx... i get no errors now and the userform load. but the picture display in the userform and i need it to show in the "blue" bar at the top next to the userform caption... is that possible? "RB Smissaert" wrote: Sorry, I had left that constant out: Private Const WM_SETICON = &H80 Put this at the other constants. RBS "pswanie" wrote in message ... i get a compile error variable not defined at this part (the first "wm_seticon" are highlighted) If hwnd < 0 Then SendMessage hwnd, WM_SETICON, ICON_SMALL, ByVal hIcon SendMessage hwnd, WM_SETICON, ICON_BIG, ByVal hIcon DrawMenuBar hwnd End If "pswanie" wrote: is there a way i can put a icon in the blue bar next to the userform name? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
Private Const ICON_SMALL = 0& Private Const wm_seticon = &H80 Private Const ICON_BIG = 1& Private Declare Function FindWindow _ Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long 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 Declare Function DrawMenuBar Lib "user32" _ (ByVal hwnd As Long) As Long Private Sub UserForm_Initialize() Dim hwnd As Long Dim hIcon As Long hIcon = Image1.Picture If Val(Application.Version) = 9 Then hwnd = FindWindow("ThunderDFrame", Me.Caption) Else hwnd = FindWindow("ThunderXFrame", Me.Caption) End If If hwnd < 0 Then SendMessage hwnd, wm_seticon, ICON_SMALL, ByVal hIcon SendMessage hwnd, wm_seticon, ICON_BIG, ByVal hIcon DrawMenuBar hwnd End If End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have copied your exact code and added it to a UserForm1
Added an Image control and added an icon. Made the Image control invisible. Added a normal module with this: Sub start() Load UserForm1 UserForm1.Show End Sub Ran this code and all working as it should. What version of Excel do you have. What kind of .ico file did you use? RBS "pswanie" wrote in message ... Option Explicit Private Const ICON_SMALL = 0& Private Const wm_seticon = &H80 Private Const ICON_BIG = 1& Private Declare Function FindWindow _ Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long 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 Declare Function DrawMenuBar Lib "user32" _ (ByVal hwnd As Long) As Long Private Sub UserForm_Initialize() Dim hwnd As Long Dim hIcon As Long hIcon = Image1.Picture If Val(Application.Version) = 9 Then hwnd = FindWindow("ThunderDFrame", Me.Caption) Else hwnd = FindWindow("ThunderXFrame", Me.Caption) End If If hwnd < 0 Then SendMessage hwnd, wm_seticon, ICON_SMALL, ByVal hIcon SendMessage hwnd, wm_seticon, ICON_BIG, ByVal hIcon DrawMenuBar hwnd End If End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
wups....!!! that my problem.... what .ico file do i need? where do i put it?
where do i get it? "RB Smissaert" wrote: Have copied your exact code and added it to a UserForm1 Added an Image control and added an icon. Made the Image control invisible. Added a normal module with this: Sub start() Load UserForm1 UserForm1.Show End Sub Ran this code and all working as it should. What version of Excel do you have. What kind of .ico file did you use? RBS "pswanie" wrote in message ... Option Explicit Private Const ICON_SMALL = 0& Private Const wm_seticon = &H80 Private Const ICON_BIG = 1& Private Declare Function FindWindow _ Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long 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 Declare Function DrawMenuBar Lib "user32" _ (ByVal hwnd As Long) As Long Private Sub UserForm_Initialize() Dim hwnd As Long Dim hIcon As Long hIcon = Image1.Picture If Val(Application.Version) = 9 Then hwnd = FindWindow("ThunderDFrame", Me.Caption) Else hwnd = FindWindow("ThunderXFrame", Me.Caption) End If If hwnd < 0 Then SendMessage hwnd, wm_seticon, ICON_SMALL, ByVal hIcon SendMessage hwnd, wm_seticon, ICON_BIG, ByVal hIcon DrawMenuBar hwnd End If End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Any normal .ico file will do.
Add the image control (this shows as a mountain and a sun in my control Toolbox and is called Image) Then right-click the control and do Properties Go to picture and select it and then press the browse button and find and add your .ico file. Should work now. RBS "pswanie" wrote in message ... wups....!!! that my problem.... what .ico file do i need? where do i put it? where do i get it? "RB Smissaert" wrote: Have copied your exact code and added it to a UserForm1 Added an Image control and added an icon. Made the Image control invisible. Added a normal module with this: Sub start() Load UserForm1 UserForm1.Show End Sub Ran this code and all working as it should. What version of Excel do you have. What kind of .ico file did you use? RBS "pswanie" wrote in message ... Option Explicit Private Const ICON_SMALL = 0& Private Const wm_seticon = &H80 Private Const ICON_BIG = 1& Private Declare Function FindWindow _ Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long 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 Declare Function DrawMenuBar Lib "user32" _ (ByVal hwnd As Long) As Long Private Sub UserForm_Initialize() Dim hwnd As Long Dim hIcon As Long hIcon = Image1.Picture If Val(Application.Version) = 9 Then hwnd = FindWindow("ThunderDFrame", Me.Caption) Else hwnd = FindWindow("ThunderXFrame", Me.Caption) End If If hwnd < 0 Then SendMessage hwnd, wm_seticon, ICON_SMALL, ByVal hIcon SendMessage hwnd, wm_seticon, ICON_BIG, ByVal hIcon DrawMenuBar hwnd End If End Sub |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
worked!!!
thank you very much!! do appreciate Phillip "RB Smissaert" wrote: Any normal .ico file will do. Add the image control (this shows as a mountain and a sun in my control Toolbox and is called Image) Then right-click the control and do Properties Go to picture and select it and then press the browse button and find and add your .ico file. Should work now. RBS "pswanie" wrote in message ... wups....!!! that my problem.... what .ico file do i need? where do i put it? where do i get it? "RB Smissaert" wrote: Have copied your exact code and added it to a UserForm1 Added an Image control and added an icon. Made the Image control invisible. Added a normal module with this: Sub start() Load UserForm1 UserForm1.Show End Sub Ran this code and all working as it should. What version of Excel do you have. What kind of .ico file did you use? RBS "pswanie" wrote in message ... Option Explicit Private Const ICON_SMALL = 0& Private Const wm_seticon = &H80 Private Const ICON_BIG = 1& Private Declare Function FindWindow _ Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long 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 Declare Function DrawMenuBar Lib "user32" _ (ByVal hwnd As Long) As Long Private Sub UserForm_Initialize() Dim hwnd As Long Dim hIcon As Long hIcon = Image1.Picture If Val(Application.Version) = 9 Then hwnd = FindWindow("ThunderDFrame", Me.Caption) Else hwnd = FindWindow("ThunderXFrame", Me.Caption) End If If hwnd < 0 Then SendMessage hwnd, wm_seticon, ICON_SMALL, ByVal hIcon SendMessage hwnd, wm_seticon, ICON_BIG, ByVal hIcon DrawMenuBar hwnd End If End Sub |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I knew you would get it in the end!
RBS "pswanie" wrote in message ... worked!!! thank you very much!! do appreciate Phillip "RB Smissaert" wrote: Any normal .ico file will do. Add the image control (this shows as a mountain and a sun in my control Toolbox and is called Image) Then right-click the control and do Properties Go to picture and select it and then press the browse button and find and add your .ico file. Should work now. RBS "pswanie" wrote in message ... wups....!!! that my problem.... what .ico file do i need? where do i put it? where do i get it? "RB Smissaert" wrote: Have copied your exact code and added it to a UserForm1 Added an Image control and added an icon. Made the Image control invisible. Added a normal module with this: Sub start() Load UserForm1 UserForm1.Show End Sub Ran this code and all working as it should. What version of Excel do you have. What kind of .ico file did you use? RBS "pswanie" wrote in message ... Option Explicit Private Const ICON_SMALL = 0& Private Const wm_seticon = &H80 Private Const ICON_BIG = 1& Private Declare Function FindWindow _ Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long 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 Declare Function DrawMenuBar Lib "user32" _ (ByVal hwnd As Long) As Long Private Sub UserForm_Initialize() Dim hwnd As Long Dim hIcon As Long hIcon = Image1.Picture If Val(Application.Version) = 9 Then hwnd = FindWindow("ThunderDFrame", Me.Caption) Else hwnd = FindWindow("ThunderXFrame", Me.Caption) End If If hwnd < 0 Then SendMessage hwnd, wm_seticon, ICON_SMALL, ByVal hIcon SendMessage hwnd, wm_seticon, ICON_BIG, ByVal hIcon DrawMenuBar hwnd End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Icon Sets - Display icon in one cell depending upon value in anoth | Excel Worksheet Functions | |||
Tom Ogilvy -- Center Userform Below Calling Toobar Icon | Excel Programming | |||
Userform Icon | Excel Programming | |||
show icon caption bar in userform | Excel Programming | |||
disable or hide the close window icon 'X' in the corner of a userform | Excel Programming |