Sign in to follow this  
Followers 0
water

Resize TreeView created with _GUICtrlTreeView_Create

3 posts in this topic

A TreeView control created with GUICtrlCreateTreeView changes its size correctly when the Window is resized.

A TreeView control created with _GUICtrlTreeView_Create doesn't change its size when the Window is resized.

I've been searching the forums but I'm obviously too blind to see what styles it needs to correctly resize a _GUICtrlTreeView_Create control

#include-once
#include <WindowsConstants.au3>
#include <GUITreeView.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>

Global $hForm1 = GUICreate("Test", 942, 717, -1, -1, BitOR($WS_CAPTION, $WS_POPUP, $WS_BORDER, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX))
;Global $hTree = _GUICtrlTreeView_Create($hForm1, 8, 24, 313, 610)
Global $TreeId = GUICtrlCreateTreeView(8, 24, 313, 610)
Global $hGUIGroupList       = GUICtrlCreateListView("Gruppe|Zugriffsrechte (Verzeichnis und Dateien)", 328, 24, 601, 305, $LVS_SHOWSELALWAYS)
Global $hGUIGroupUserList   = GUICtrlCreateListView("Name|Typ", 328, 352, 601, 282, $LVS_SHOWSELALWAYS)
GUISetState(@SW_SHOW)

While 1
    $vMsg = GUIGetMsg()
    Select
        Case $vMsg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites



water

Example:

#include-once
#include <WindowsConstants.au3>
#include <GUITreeView.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>

Global $hForm1 = GUICreate("Test", 300, 200, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))

Global $hTree = _GUICtrlTreeView_Create($hForm1, 10, 10, 150, 180)

GUIRegisterMsg($WM_SIZE, "_WM_SIZE")

GUISetState(@SW_SHOW)

While 1
    $vMsg = GUIGetMsg()
    Select
        Case $vMsg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Func _WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    Local $iWidth = BitAND($lParam, 0x0000FFFF)
    Local $iHeight = BitShift($lParam, 16)
    
    _WinAPI_MoveWindow($hTree, 10, 10, $iWidth - 150, $iHeight - 20)
EndFunc   ;==>_WM_SIZE

Share this post


Link to post
Share on other sites

Hi rasim,

thanks a lot!

That really helps to improve my script.

Thomas


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0