创建的状态栏如何随GUI改变而改变
本帖最后由 autoit3CN 于 2009-6-7 03:16 编辑#include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Global $iMemo, $MainGUI, $hStatus
Example1()
Func Example1()
Local $hGUI
Local $aParts =
; Create GUI
$hGUI = GUICreate("(Example 1) StatusBar Create", 700, 700,100,100,$WS_OVERLAPPEDWINDOW)
$hStatus = _GUICtrlStatusBar_Create ($hGUI)
_GUICtrlStatusBar_SetParts ($hStatus, $aParts)
; Create memo control
$iMemo = GUICtrlCreateEdit("一旦最大化,状态栏就无法跟着变化,如何解决", 2, 2, 396, 274, $WS_VSCROLL)
GUICtrlSendMsg($iMemo, $EM_SETREADONLY, True, 0)
GUICtrlSetBkColor($iMemo, 0xFFFFFF)
GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUISetState(@SW_ENABLE, $MainGUI)
GUIDelete($hGUI)
EndFunc ;==>Example1 注册WM_SIZE消息,在自定义函数里面调整状态栏的位置。 #include <GuiConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Global $iMemo, $MainGUI, $hStatus
Example1()
Func Example1()
Local $hGUI
Local $aParts =
$hGUI = GUICreate("(Example 1) StatusBar Create", 500, 500, -1,-1,$WS_OVERLAPPEDWINDOW)
$iMemo = GUICtrlCreateEdit("一旦最大化,状态栏就无法跟着变化,如何解决", 0, 0, 500, 450, $WS_VSCROLL)
GUICtrlSendMsg($iMemo, $EM_SETREADONLY, True, 0)
GUICtrlSetBkColor($iMemo, 0xFFFFFF)
$hStatus = _GUICtrlStatusBar_Create($hGUI)
_GUICtrlStatusBar_SetParts($hStatus, $aParts)
GUISetState()
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUISetState(@SW_ENABLE, $MainGUI)
GUIDelete($hGUI)
EndFunc ;==>Example1
Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
_GUICtrlStatusBar_Resize($hStatus)
Return $GUI_RUNDEFMSG
EndFunc 学习一下。。 学习中...
:face (12):
页:
[1]