Sign in to follow this  
Followers 0
pbw

resizing rebar

1 post in this topic

I am trying to make a GUI with a rebar.  The problem I have is is that when the user adjusts the rebar vertically using a gripper, the gui controls get covered up. Id like to prevent the user from resizing the toolbar vertically, or very much preferably, reposition the controls anytime the progressbar has a vertical height change. Has anyone dealt with this before and could offer a solution?

#include <GuiReBar.au3>
#include <GuiComboBox.au3>
#include <GuiDateTimePicker.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>

Example()

Func Example()
    Local $hgui, $btnExit, $hCombo, $hReBar, $hDTP, $hInput

    $hgui = GUICreate("Rebar", 400, 396, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX))

    ; create the rebar control
    $hReBar = _GUICtrlRebar_Create($hgui, BitOR($CCS_TOP, $WS_BORDER, $RBS_VARHEIGHT, $RBS_AUTOSIZE, $RBS_BANDBORDERS))

    ; create a combobox to put in the rebar
    $hCombo = _GUICtrlComboBox_Create($hgui, "", 0, 0, 120)

    _GUICtrlComboBox_BeginUpdate($hCombo)
    _GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.exe")
    _GUICtrlComboBox_EndUpdate($hCombo)

    ; create a date time picker to put in the rebar
    $hDTP = _GUICtrlDTP_Create($hgui, 0, 0, 190)

    ; create a input box to put in the rebar
    $hInput = GUICtrlCreateInput("Input control", 0, 0, 120, 20)

    ; add band with control
    _GUICtrlRebar_AddBand($hReBar, $hCombo, 120, 200, "Dir *.exe")

    ; add and force to second row
    _GUICtrlRebar_AddBand($hReBar, $hDTP, 120)
    _GUICtrlRebar_SetBandStyleBreak($hReBar, 1)

    ; add to beginning of rebar
    _GUICtrlRebar_AddBand($hReBar, GUICtrlGetHandle($hInput), 120, 200, "Name:", 0)

    $btnExit = GUICtrlCreateButton("Exit", 150, 60, 100, 25)
    GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $btnExit
                Exit
        EndSwitch
    WEnd
EndFunc   ;==>Example

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