Rocky Smolin
rockysmolin at bchacc.com
Thu Apr 21 11:39:20 CDT 2011
Yep. -----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:30 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar No problem. Was this for that 'always on top' form? 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:23 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: Worked perfectly. Thank you. 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