[AccessD] Hide Form Title Bar

Drew Wutka DWUTKA at Marlow.com
Sat Apr 23 21:18:15 CDT 2011


Interesting.  Not sure why 2007 would do anything different, but then
again, it is 2007... LOL

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Saturday, April 23, 2011 9:25 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Hide Form Title Bar

Yes, it does. And that helps.  There are twenty five controls on the
form,
ten pairs of command button/labels and five other command buttons.  So
having the ability to drag by a label helps.  

On my 2008 machine, the form has the title bar showing when it opens.
As
soon as you resize the form by dragging and where on the border, the
title
bar gets minimized but doesn't go away.  So you can still drag by the
title
bar.  

At the end of the day yesterday, the client reported that the latest
version
I sent him was not allowing him to drag at all. So Monday we're going to
fire up Team Viewer and I'll see what's what on his machine, which is
running 2007.

R


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Saturday, April 23, 2011 6:17 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Hide Form Title Bar

Do the labels let you drag the form if you put the code behind their
mousedown events?

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Friday, April 22, 2011 8:03 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Hide Form Title Bar

On my 2007, you can't drag the form by clicking below the lowest
control, as
you can in 2003.  But there's this little strip along the top of the
form
that's a different color than the other three sides and looks a bit like
a
squashed down title bar.  I can drag by that.

R 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Friday, April 22, 2011 5:43 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Hide Form Title Bar

Odd, I actually tested it in 2007.....  do you get an error message?  

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Friday, April 22, 2011 4:40 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Hide Form Title Bar

Drew:

So here's a complication - works perfectly in 2003, but not in 2007.
Any
idea why they broke it? :)

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Thursday, April 21, 2011 9:51 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Hide Form Title Bar

I wouldn't say 'normal', but the code example is based on the 'Detail'
Sections 'MouseDown' event.  

So if the only 'area' of the Details section is the spot below your
controls, then that is the only area that would work with that event.
You can put that code inside the mousedown event of each control that
isn't
currently reacting to a 'click', like the labels for elapsed time, and
they
will allow the same behavior.

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Thursday, April 21, 2011 11:29 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Hide Form Title Bar

Drew:

It worked but here's an odd thing.  The form consists of five small
command
buttons on the left .  To the right of them are ten more  command
buttons
and below each of the ten is a label that shows elapsed time.  The form
will
drag only if the mouse is pressed below the lowest control on the form.
Normal behavior?

TIA

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Thursday, April 21, 2011 8:34 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Hide Form Title Bar

So here's how you fix that problem:

'Put the following in the declarations:

Private Declare Function ReleaseCapture Lib "user32" () 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 Const HTCAPTION = 2
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const WM_SYSCOMMAND = &H112


'Put the ReleaseCapture and SendMessage lines in the MouseDown even of
your
form's detail section as below

Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single) ReleaseCapture SendMessage Me.hwnd,
WM_NCLBUTTONDOWN,
HTCAPTION, 0& End Sub



Those two lines are going to make the 'detail' section act like a
window's
title bar in letting a using click and drag the window.

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Wednesday, April 20, 2011 11:22 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Hide Form Title Bar

Lambert:

Thanks so much. That worked like a charm.  Wish I could understand what
was
going on there.

Only problem is that I now can't drag the form out of the way of what
it's
blocking and that might be a big problem for the user.

Best,

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan,
Lambert
Sent: Wednesday, April 20, 2011 7:46 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Hide Form Title Bar

I had a need for a form with no border at all, and Google helped me find
the
code. Regrettably I did not record where I got it, so I cannot credit
the
author, but a simple API call did the trick.
 
In the form's module include this...

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long,
_
    ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long,
ByVal
cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    
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_BORDER = &H800000 Private Const WS_MAXIMIZEBOX =
&H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME
=
&H400000 Private Const WS_THICKFRAME = &H40000 Private Const
SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const
SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4


Then, for my borderless for the form's Load event was...

Private Sub Form_Load()
Dim lStyle As Long
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not
(WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or
WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE
Or
SWP_NOZORDER End Sub

By changing that load event to the following you wind up with a form
with no
title bar but with a sizable border (though it starts out with a height
that
includes the invisible title bar???).

Private Sub Form_Load()
Dim lStyle As Long
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not
(WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call
SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub

Be sure to set the form's border style to Sizable.

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Tuesday, April 19, 2011 4:37 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Hide Form Title Bar

Dear List:
 
I want to eliminate the form title bar on a pop up form but still need
the
border to be sizable.  Is there a way to do this?
 
MTIA
 

Rocky Smolin

Beach Access Software

858-259-4334

Skype: rocky.smolin

www.e-z-mrp.com <http://www.e-z-mrp.com/> 

www.bchacc.com <http://www.bchacc.com/> 

 

 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com The information contained in
this
transmission is intended only for the person or entity to which it is
addressed and may contain II-VI Proprietary and/or II-VI Business
Sensitive
material. If you are not the intended recipient, please contact the
sender
immediately and destroy the material in its entirety, whether electronic
or
hard copy. 
You are notified that any review, retransmission, copying, disclosure,
dissemination, or other use of, or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is
prohibited.


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com The information contained in
this
transmission is intended only for the person or entity to which it is
addressed and may contain II-VI Proprietary and/or II-VI Business
Sensitive
material. If you are not the intended recipient, please contact the
sender
immediately and destroy the material in its entirety, whether electronic
or
hard copy. 
You are notified that any review, retransmission, copying, disclosure,
dissemination, or other use of, or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is
prohibited.


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com The information contained in
this
transmission is intended only for the person or entity to which it is
addressed and may contain II-VI Proprietary and/or II-VI Business
Sensitive
material. If you are not the intended recipient, please contact the
sender
immediately and destroy the material in its entirety, whether electronic
or
hard copy. 
You are notified that any review, retransmission, copying, disclosure,
dissemination, or other use of, or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is
prohibited.


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com The information contained in
this
transmission is intended only for the person or entity to which it is
addressed and may contain II-VI Proprietary and/or II-VI Business
Sensitive
material. If you are not the intended recipient, please contact the
sender
immediately and destroy the material in its entirety, whether electronic
or
hard copy. 
You are notified that any review, retransmission, copying, disclosure,
dissemination, or other use of, or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is
prohibited.


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
The information contained in this transmission is intended only for the person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI Business 
Sensitive material. If you are not the intended recipient, please contact the sender 
immediately and destroy the material in its entirety, whether electronic or hard copy. 
You are notified that any review, retransmission, copying, disclosure, dissemination, 
or other use of, or taking of any action in reliance upon this information by persons 
or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list