Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant figure out how these buttons have been hidden!

Status
Not open for further replies.

netsmurph

Technical User
Mar 19, 2003
63
GB
Ive been asked to make some changes to an access app developed over the last couple of years (and of course without any doco). One simple request was to make max/min & close buttons visible.

Have enabled them on the form properties, have tried a number of different functions to reset this within code but am stumpted!

I cannot find where in the code these are being disabled on the main form and dont know where else to look.

Here is a snippet of the last code that i used to no avail:

Private Const GWL_EXSTYLE = (-20)
Private Const GWL_STYLE = (-16)

Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_SYSMENU = &H80000

Private Const HWND_TOP = 0
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_DRAWFRAME = SWP_FRAMECHANGED

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 GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
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

Sub UnHideAccessCloseButton()

Dim lngStyle As Long

lngStyle = GetWindowLong(hWndAccessApp, GWL_STYLE)
lngStyle = lngStyle Or WS_SYSMENU
Call SetWindowLong(hWndAccessApp, GWL_STYLE, lngStyle)
Call SetWindowPos(hWndAccessApp, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_DRAWFRAME)

End Sub


Any help would be much appreciated.


Andrew
 
HI
If you look at your form in design view you will see a little black square top left of the ruler (making the ruler visible from the view menu helps)

Put your pointer over this and right click
Select properties from the menu options listed
lengthen the box and MinMax buttons property can be enabled from here.

These properties are the form properties not the objects on the form which have their own properties list

HOpe this helps

jo
 
Jo

Many thanks for your reply - I have tried this and have ensured that these are enabled, but no dice!

I am sure it is done using vba code, but cannot see where in the beast it is done!

Will keep on searching!

A
 
When trying to find out where something has been done in code, we tend to look only in the form's code, forgetting that things sometimes get done in modules! A bit of code that doesn't appear to have anything to do with turning off these controls in your form code may, in fact, call a function in a module to do the same thing. Have a look there.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top