User Form Title Bar

164 views
Skip to first unread message

Celtic_Avenger

unread,
Oct 30, 2004, 12:34:11 PM10/30/04
to

Hi Peeps.....Hope someone can help.


Is there a simple way to remove the titlebar on a userform.

The reason I need this is because I am using a simple buttonless
userform to display a warning if certain cells are selected. This
userform then disappears after a time delay.

I dont want the user to be able to click the X button on the userform
titlebar.

Hope someone can help.


Thanks in advance.


Celtic_Avenger
:confused: :confused: :confused: :confused: :confused:


--
Celtic_Avenger
------------------------------------------------------------------------
Celtic_Avenger's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=14101
View this thread: http://www.excelforum.com/showthread.php?threadid=273874

Michel Pierron

unread,
Oct 30, 2004, 1:16:18 PM10/30/04
to
Hi Celtic_Avenger,
In the UserForm module:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long _
, ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" _
(ByVal hWnd As Long) As Long

Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84080080
DrawMenuBar hWnd
End Sub

MP

"Celtic_Avenger" <Celtic_Ave...@excelforum-nospam.com> a écrit dans
le message de news:Celtic_Ave...@excelforum-nospam.com...

Celtic_Avenger

unread,
Oct 30, 2004, 1:31:04 PM10/30/04
to

Michel Pierron


Thanks very much indeed.

This has worked perfectly.

Your a star.


Celtic_Avenger
:) :cool: :) :cool: :)

Reply all
Reply to author
Forward
0 new messages