Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time? 
Author Message
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

Subject: Does anybody know how to programmatically remove the entire title bar and Control Box from a form at run-time?

I would assume that this requires use of the API.



Sat, 16 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

Al (I doubt it),

Quote:
>>Subject: Does anybody know how to programmatically remove the entire title

bar and Control Box from a form at run-time?

Quote:
>>I would assume that this requires use of the API.

As far as I know, there is no way to change the title style of a window once
it has been created. If you saw a program do this, I wouldn't be surprised
if it actually destroyed and then recreated the window with the new style.
This would be something you just couldn't do in VB.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com



Sat, 16 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

A window with a titlebar is built from a different class than one without --
once the window is created, I don't think it's possible to change it. You'd
have to remove it and put up another window.

You can make your own title bar on a regular form without one, then do with
it what you please. There are some exaples around the web but I don't
remember where exactly.

Quote:

>Subject: Does anybody know how to programmatically remove the
>entire title bar and Control Box from a form at run-time?

>I would assume that this requires use of the API.



Sat, 16 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

Don-
        What is this- a April fools joke?  The subject
says "programatically" remove the control box.
Setting a property at design time doesn't sound
like programatically to me. I would go with Jonathan's
answer- it's a tall order with VB.
                                        Joe
--
***********************************************************

Microsoft Developer MVP- Visual Basic
Check out Yankee Clipper Plus (April 1998
PCWorld magazine "Best Free Stuff Online")
www.tiac.net/users/lvasseur/ycphome.html
**********************************************************
PS- Please reply to the newsgroup- except in the
case of flames, insults, etc. (Don't bother.)



Quote:
> turn controls off in properties
> set max false
> min false
> and caption empty
> there you go

> Regards
> don grover


> >Al (I doubt it),

> >>>Subject: Does anybody know how to programmatically remove the entire
> title
> >bar and Control Box from a form at run-time?
> >>>I would assume that this requires use of the API.

> >As far as I know, there is no way to change the title style of a window
> once
> >it has been created. If you saw a program do this, I wouldn't be
surprised
> >if it actually destroyed and then recreated the window with the new
style.
> >This would be something you just couldn't do in VB.

> >--
> >Jonathan Wood
> >SoftCircuits Programming
> >http://www.softcircuits.com



Sat, 16 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

You can do this with the GetWindowLong and SetWindowLong APIs:

Dim l As Long
l = GetWindowLong(Me.hWnd, GWL_STYLE)
l = l And Not (WS_OVERLAPPED Or WS_CAPTION)
SetWindowLong Me.hWnd, GWL_STYLE, l

--
Ben Baird, MVP
Microsoft SiteBuilder Network Level 2
Visual Basic Thunder, v. 2.0
http://www.{*filter*}highway.com/~psy/
Common Controls Replacement Project, Official Member
http://www.*-*-*.com/
Please direct your programming questions to the newsgroups.



Sat, 16 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

turn controls off in properties
set max false
min false
and caption empty
there you go

Regards
don grover

Quote:

>Al (I doubt it),

>>>Subject: Does anybody know how to programmatically remove the entire
title
>bar and Control Box from a form at run-time?
>>>I would assume that this requires use of the API.

>As far as I know, there is no way to change the title style of a window
once
>it has been created. If you saw a program do this, I wouldn't be surprised
>if it actually destroyed and then recreated the window with the new style.
>This would be something you just couldn't do in VB.

>--
>Jonathan Wood
>SoftCircuits Programming
>http://www.softcircuits.com



Sun, 17 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

Thanks for that. It helped me get over a problem I was having with my
monitor app.

Great post!



Sun, 17 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?


Fri, 19 Jun 1992 00:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

I try not to kick anything if I can help it. Doesn't get anybody anywhere
you know...

Quote:
>Thanks for all your help, Ben.  That was exactly what I needed.  I'm

attempting to create docking >windows in VB, and it is essential to be able
to change the style of the windows.  Have you ever >delved into the concept
of creating docking windows in VB? I know StingRay Software has done >it,
but their control is just a bit too pricey for me.
I've done docking windows before. If you have any specific questions about
concept I'll try and answer them, but I don't plan to give any source away
:-)

--
Ben Baird, MVP
Microsoft SiteBuilder Network Level 2
Visual Basic Thunder, v. 2.0
http://www.{*filter*}highway.com/~psy/
Common Controls Replacement Project, Official Member
http://www.*-*-*.com/
Please direct your programming questions to the newsgroups.



Sun, 17 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

Hey Ben 'Ole Buddy-
    What flavor of Form are you starting with for this to work?
I'm just getting a strange-looking form that doesn't lose the
titlebar until I resize. I'm pasting in the code below. I must
be missing something obvious. Code below is from the default
"Form1". (This could be useful for me in a project I'm
working on- in conjunction with my routine to set "ShowInTaskbar"
at runtime.)
    Better watch that *** kickin' , what would your mom say? (;-)
Joe
_______________snip___________________________________________
Option Explicit
Private Declare Function GetWindowLong Lib _
   "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, _
   ByVal nIndex As Long) 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 Const GWL_STYLE = (-16)
Private Const WS_OVERLAPPED = &H0&
Private Const WS_CAPTION = &HC00000

Private Sub Form_Load()
   Dim l As Long
   l = GetWindowLong(Me.hwnd, GWL_STYLE)
   l = l And Not (WS_OVERLAPPED Or WS_CAPTION)
   SetWindowLong Me.hwnd, GWL_STYLE, l
   Refresh
End Sub
_____________snip______________________________________________-

--
*******************************************************************

Microsoft Developer MVP Visual Basic
Try Yankee Clipper Plus( April 1998 PCWorld "Best
Free Stuff Online" )
http://www.*-*-*.com/
================================================
"When we are planning for posterity, we ought to
remember that virtue is not hereditary." Thomas Paine
*******************************************************************

Quote:

>I try not to kick anything if I can help it. Doesn't get anybody anywhere
>you know...

>>Thanks for all your help, Ben.  That was exactly what I needed.  I'm
>attempting to create docking >windows in VB, and it is essential to be able
>to change the style of the windows.  Have you ever >delved into the concept
>of creating docking windows in VB? I know StingRay Software has done >it,
>but their control is just a bit too pricey for me.

>I've done docking windows before. If you have any specific questions about
>concept I'll try and answer them, but I don't plan to give any source away
>:-)

>--
>Ben Baird, MVP
>Microsoft SiteBuilder Network Level 2
>Visual Basic Thunder, v. 2.0
>http://www.{*filter*}highway.com/~psy/
>Common Controls Replacement Project, Official Member
> http://www.*-*-*.com/
>Please direct your programming questions to the newsgroups.



Sun, 17 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

Hi Joe -

Quote:
>    What flavor of Form are you starting with for this to work?
>I'm just getting a strange-looking form that doesn't lose the
>titlebar until I resize.

That's because the form has no way of knowing that it needs to be
repainted... I suppose you could add another line at the end of the code I
supplied:

Me.Width = Me.Width + Screen.TwipsPerPixelX

That always worked for me, and the change in size is barely noticable (you
could resize it back if you really wanted to). I believe the problem with
using Refresh is that this command only repaints the client area.
--
Ben Baird, MVP
Microsoft SiteBuilder Network Level 2
Visual Basic Thunder, v. 2.0
http://www.{*filter*}highway.com/~psy/
Common Controls Replacement Project, Official Member
http://www.*-*-*.com/
Please direct your programming questions to the newsgroups.



Sun, 17 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

Ben-
    Thanks a lot. That was it. (:-)
Joe
--
*******************************************************************

Microsoft Developer MVP Visual Basic
Try Yankee Clipper Plus( April 1998 PCWorld "Best
Free Stuff Online" )
http://www.*-*-*.com/
================================================
"When we are planning for posterity, we ought to
remember that virtue is not hereditary." Thomas Paine
*******************************************************************

Quote:
>Hi Joe -

>>    What flavor of Form are you starting with for this to work?
>>I'm just getting a strange-looking form that doesn't lose the
>>titlebar until I resize.

>That's because the form has no way of knowing that it needs to be
>repainted... I suppose you could add another line at the end of the code I
>supplied:

>Me.Width = Me.Width + Screen.TwipsPerPixelX

>That always worked for me, and the change in size is barely noticable (you
>could resize it back if you really wanted to). I believe the problem with
>using Refresh is that this command only repaints the client area.
>--
>Ben Baird, MVP
>Microsoft SiteBuilder Network Level 2
>Visual Basic Thunder, v. 2.0
>http://www.{*filter*}highway.com/~psy/
>Common Controls Replacement Project, Official Member
> http://www.*-*-*.com/
>Please direct your programming questions to the newsgroups.



Sun, 17 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?


Quote:
>Hi Joe -

>>    What flavor of Form are you starting with for this to work?
>>I'm just getting a strange-looking form that doesn't lose the
>>titlebar until I resize.

>That's because the form has no way of knowing that it needs to be
>repainted... I suppose you could add another line at the end of the code I
>supplied:

>Me.Width = Me.Width + Screen.TwipsPerPixelX

>That always worked for me, and the change in size is barely noticable (you
>could resize it back if you really wanted to). I believe the problem with
>using Refresh is that this command only repaints the client area.

Back when I was changing a form back and forth from resizeable to fixed in
VB3 (WS_THICKFRAME to WS_BORDER to us API geeks), I learned that you needed
to call an API function to force the form to recognize its new window style.
It was SetWindowPos with the SWP_FRAMECHANGED flag. It should work here,
too.


Sun, 17 Sep 2000 03:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?


Fri, 19 Jun 1992 00:00:00 GMT  
 Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

You can indeed do this. Frankly I am a bit surprized that no one else put
anything in here...

Here goes. I have used this code to remove the title bar from a MDI form so
it should work with regulars as well.

Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA"
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA"
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Public Const GWL_STYLE = (-16)
    Public Const WS_BORDER = &H800000

'THIS TAKES IT AWAY

Dim L as long

    with form
        L = GetWindowLong(.hwnd, GWL_STYLE)
        L = L And Not (WS_BORDER)
        L = SetWindowLong(.hwnd, GWL_STYLE, L)
    end with

'This puts it back
with form
       L = GetWindowLong(.hwnd, GWL_STYLE)
        L = L Or WS_BORDER
        L = SetWindowLong(.hwnd, GWL_STYLE, L)
end with

Hope that helps. Let me know

Ben
=========================
Ben Andersen
BHAndersen Group

========================

Subject: Does anybody know how to programmatically remove the entire title
bar and Control Box from a form at run-time?

I would assume that this requires use of the API.



Sun, 17 Sep 2000 03:00:00 GMT  
 
 [ 22 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Does anybody know how to programatically remove the entire title bar and Control Box from a form at run-time?

2. Q: Removing title bar and/or Menu bar from a window

3. Removing Title Bar & Control Box from MDIforms

4. Doe's anybody knows how to...

5. VB Gradient Title Bars! <--DONE

6. Change Font in title bar of mdi child/Hide title bar

7. Change Font in title bar of mdi child/Hide title bar

8. remove title bar from a form

9. Remove title bar from Userform or Window

10. Removing "Microsoft Word" from Title Bar

11. Removing the title bar from a form

12. Remove title bar and more

 

 
Powered by phpBB® Forum Software