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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Minimize and Maximize button in Accpac macro

Status
Not open for further replies.

CaroV

Programmer
May 25, 2011
4
US
thread631-1375849
Hello I just joinned the forum and saw somebody posted a very interesting solution for adding the macro+ocx in the task bar with Minimize button. My question: How can I add the Maximized button?
I tried but after maximizing it and wanting to restore it keeps the controls maximized.
Thanks in advance
 
Private Const GWL_STYLE As Long = (-16)
Private Const WS_MINIMIZEBOX As Long = &H20000
Private Const WS_MAXIMIZEBOX As Long = &H10000

Private Sub AddMinimizeButton()
Dim hWnd As Long
hWnd = GetActiveWindow
Call SetWindowLong(hWnd, GWL_STYLE, _
GetWindowLong(hWnd, GWL_STYLE) Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)
Call SetWindowPos(hWnd, 0, 0, 0, 0, 0, _
SWP_FRAMECHANGED Or _
SWP_NOMOVE Or _
SWP_NOSIZE)
End Sub
 
Hello tuba2007. Thanks so much for your response. I tried something very similar of what you have posted but my problem persist and is when you restore the window back to its original size after maximizing it. The grid keep being maximized even after restored the window. I'm testing with P/O Receipt Entry
 
I always use VB when I have grids, then I can resize the UI in the Form_Rezize subroutine. You probably need to reset the .Height and .Width of your Accpac UI control.
 
Yes, I tried to use UserForm.Resize event but every single control (grids/tabs/buttons etc) needs to be re-positioned :(
 
Thanks so much for all your responses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top