- Offizieller Beitrag
Wenn ich eine Rebar an die Größe der GUI anpasse, dann werden die einzelnen Elemente nicht refresht (siehe Screenshots).
Wie kann ich das refreshen hinkriegen?
Spoiler anzeigen
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GuiReBar.au3>
#include <GuiToolBar.au3>
#include <GuiComboBox.au3>
#include <GuiDateTimePicker.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <GuiConstantsEx.au3>
Opt("MustDeclareVars", 1)
$Debug_RB = False
Global $hReBar
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
_main()
Func _main()
Local $hgui, $btnExit, $hToolbar, $hCombo, $hDTP, $hInput
Local Enum $idNew = 1000, $idOpen, $idSave, $idHelp
$hgui = GUICreate("Rebar", 400, 396, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $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 toolbar to put in the rebar
$hToolbar = _GUICtrlToolbar_Create($hgui, BitOR($TBSTYLE_FLAT, $CCS_NORESIZE, $CCS_NOPARENTALIGN))
; Add standard system bitmaps
Switch _GUICtrlToolbar_GetBitmapFlags($hToolbar)
Case 0
_GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_SMALL_COLOR)
Case 2
_GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)
EndSwitch
; Add buttons
_GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW)
_GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN)
_GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE)
_GUICtrlToolbar_AddButtonSep($hToolbar)
_GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP)
; 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)
; add band with control
_GUICtrlRebar_AddBand($hReBar, $hCombo, 120, 200, "Dir *.exe")
; add band with date time picker
_GUICtrlRebar_AddBand($hReBar, $hDTP, 120)
; add band with toolbar to begining of rebar
_GUICtrlRebar_AddToolBarBand($hReBar, $hToolbar, "", 0)
;add another control
_GUICtrlRebar_AddBand($hReBar, GUICtrlGetHandle($hInput), 120, 200, "Name:")
$btnExit = GUICtrlCreateButton("Exit", 150, 360, 100, 25)
GUISetState(@SW_SHOW)
Sleep(1000)
WinMove($hgui, '', Default, Default, 500)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $btnExit
Exit
EndSwitch
WEnd
EndFunc ;==>_main
Func WM_SIZE($hWnd)
Local $wpos
$wpos = WinGetPos($hWnd)
ControlMove($hWnd, "", $hReBar, 0, 0, $wpos[2])
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_SIZE
Func WM_NOTIFY()
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
"!===========================================================" & @LF & _
"+======================================================" & @LF & _
"-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
"+======================================================" & @LF)
EndFunc ;==>_DebugPrint