Remove Title Bar from form

Remove Title Bar from form

Anonymous
Not applicable
797 Views
11 Replies
Message 1 of 12

Remove Title Bar from form

Anonymous
Not applicable
Does anyone have a way of removing a title bar from a form?? I've seen it done in Excel, Word and Access, but not ACAD.

--
Matt W
[Insert funny quote/saying here]
0 Likes
798 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable
Just the text or the entire titlebar itself?

Joe ...


"Matt W" wrote in message
news:5229069@discussion.autodesk.com...
Does anyone have a way of removing a title bar from a form?? I've seen it
done in Excel, Word and Access, but not ACAD.

--
Matt W
[Insert funny quote/saying here]
0 Likes
Message 3 of 12

Anonymous
Not applicable
The entire title bar.

Removing the text would require simply deleting the caption text, correct? Or are you implying something else??!?

--
Matt W
[Insert funny quote/saying here]
0 Likes
Message 4 of 12

Anonymous
Not applicable
Here are my subs for disabling the close box or removing the title bar.

Regards - Nathan

Option Explicit
Private Declare Function GetActiveWindow Lib "user32.dll" () As Long
Private Declare Function GetSystemMenu Lib "user32.dll" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32.dll" (ByVal hMenu As Long, ByVal uPosition As Long, ByVal uFlags As Long) As Long
Private Declare Function DrawMenuBar Lib "user32.dll" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Public Sub DisableClose()
Dim hwnd As Long
Dim hMenu As Long
hwnd = GetActiveWindow()
hMenu = GetSystemMenu(hwnd, 0)
Call RemoveMenu(hMenu, 6, &H400)
Call RemoveMenu(hMenu, 5, &H400)
Call DrawMenuBar(hwnd)
End Sub

Public Sub Remove()
Dim hwnd As Long
Dim dwNewLong As Long
hwnd = GetActiveWindow()
dwNewLong = GetWindowLong(hwnd, -16)
dwNewLong = dwNewLong And Not &HC00000
Call SetWindowLong(hwnd, -16, dwNewLong)
DrawMenuBar hwnd
End Sub
0 Likes
Message 5 of 12

Anonymous
Not applicable
Nice! Just what I needed.

Thanks, Nathan!

--
Matt W
[Insert funny quote/saying here]
0 Likes
Message 6 of 12

Anonymous
Not applicable
How exactly would this be implimented? UserForm_Initialize()?

thanks,

jb
0 Likes
Message 7 of 12

Anonymous
Not applicable
Wow - my AutoCAD title bar is gone now!! Cool!
0 Likes
Message 8 of 12

Anonymous
Not applicable
Hi,

Try the attached file..just remove .txt from the file.
and run it in AutoCAD (tested under 2006)
Have fun.

- A Caddie
0 Likes
Message 9 of 12

Anonymous
Not applicable
ps. The form can be resized, if the titlebar is removed you can still move the form by grabbing the form and drag it around.

(part of a bigger application)
and thanks to the people who helped.

- A Caddie.
0 Likes
Message 10 of 12

arcticad
Advisor
Advisor
Wow! I am uber impressed!!. What if i want the title bar back or make the cancel button active again?
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 11 of 12

Anonymous
Not applicable
You can change the settings at run time, just look at the code behind the command buttons.

sample:
AutoCADFormChanger.ShowCaption = False
this removes the caption.

AutoCADFormChanger.ShowCaption = True
here the caption is shown again.

there are more properties in the Class:

.ShowCloseBtn
.ShowMaximizeBtn
.ShowMinimizeBtn

set them to true or false

- A Caddie
0 Likes
Message 12 of 12

arcticad
Advisor
Advisor
Cool Thank You. I just need to know how to doc a userform in Autocad now. the whole accont activeX is eluding me. I've been trying to make a userform moveable without selecting the titlebar for months. Good Job.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes