Rez,
I have to credit ACEMAN1 for this but this works for me.
If you want your form or forms to be blank just download an icon editor, create a blank icon and Set your path to that blank icon.
Open a new module in the modules window. Then copy/paste the following code:
CODE
Private 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
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 GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Private Const WM_SETICON = &H80
Private Const IMAGE_ICON = 1
Private Const LR_LOADFROMFILE = &H10
Private Const SM_CXSMICON As Long = 49
Private Const SM_CYSMICON As Long = 50
Public Function SetFormIcon(hWnd As Long, strIconPath As String) As Boolean
Dim lIcon As Long
Dim lResult As Long
Dim X As Long, Y As Long
X = GetSystemMetrics(SM_CXSMICON)
Y = GetSystemMetrics(SM_CYSMICON)
lIcon = LoadImage(0, strIconPath, 1, X, Y, LR_LOADFROMFILE)
lResult = SendMessage(hWnd, WM_SETICON, 0, ByVal lIcon)
End Function
Next . . . copy/paste the following code in the On Open event of any form you wish to control the icon (you substitute Path\FileName with the full path & filename of the *.ico file):
CODE
SetFormIcon Me.hWnd, "Path\FileName"
Good Luck!
Thanks, Rib
Bartender:Hey aren't you that rope I threw out an hour ago?
Rope:No, I'm a frayed knot.