Jump to content

Recommended Posts

Posted

Hi,

I will explain my problem with some images because I don't know how to do it with words...

At start I have this :

Posted Image

If I resize the GUI with the function WM_SIZE, the controls resizes according to their resize parameters (given with GUICtrlSetResizing)

Posted Image

But if I move down the scrollbar and I resize the GUI, the controls will stuck at the "new" top of the window :

Posted Image

The problem is solved with the function WM_SIZE but when I resize the GUI, the controls are stuck to the top left and don't resize...

Posted Image

Here is my WM_SIZE function :

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    #forceref $Msg, $wParam

    Local $index = -1, $yChar, $xChar, $xClientMax, $xClient, $yClient, $ivMax

    For $x = 0 To UBound($aSB_WindowInfo) - 1
        If $aSB_WindowInfo[$x][0] = $hWnd Then
            $index = $x
            $xClientMax = $aSB_WindowInfo[$index][1]
            $xChar = $aSB_WindowInfo[$index][2]
            $yChar = $aSB_WindowInfo[$index][3]
            $ivMax = $aSB_WindowInfo[$index][7]
            ExitLoop
        EndIf
    Next
    If $index = -1 Then Return 0

    ; Retrieve the dimensions of the client area.
    $xClient = BitAND($lParam, 0x0000FFFF)
    $yClient = BitShift($lParam, 16)
    $aSB_WindowInfo[$index][4] = $xClient
    $aSB_WindowInfo[$index][5] = $yClient

    Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT)

    DllStructSetData($tSCROLLINFO, "nPos", 0)
    _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_SIZE

So I'm wondering if it's possible to edit the WM_SIZE function to solve this issue.

Br, FireFox.

  • Moderators
Posted

FireFox,

I did some work recently which you can see here on getting controls to behave when resizing GUIs with scrollbars that were not at the top left - it might help. It is based on my Scrollbars UDF although it should not be difficult to amend it for the "normal" GUIScrollbar UDF. :>

Please let me know if you have problems as I am still working on it. :unsure:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...