Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Icon
Hello, How do you set an icon/bitmap in the caption field of a userform? Thanks all.. -- gti_jobert ------------------------------------------------------------------------ gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634 View this thread: http://www.excelforum.com/showthread...hreadid=521752 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Icon
Have a Userform with an Image control with in it the icon.
Get the icon in the control by clicking the file browser button in the Picture property. I don't think the properties of the Image control matter much, but Visible would normally be False. Then in the Userform have this code: Option Explicit Private Const ICON_SMALL = 0& 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 Then just load the form the normal way. RBS "gti_jobert" wrote in message ... Hello, How do you set an icon/bitmap in the caption field of a userform? Thanks all.. -- gti_jobert ------------------------------------------------------------------------ gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634 View this thread: http://www.excelforum.com/showthread...hreadid=521752 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Icon Sets - Display icon in one cell depending upon value in anoth | Excel Worksheet Functions | |||
show icon caption bar in userform | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
disable or hide the close window icon 'X' in the corner of a userform | Excel Programming |