找回密码
 加入
搜索
查看: 1724|回复: 3

求助,rebar控件被重绘

[复制链接]
发表于 2009-1-10 05:44:02 | 显示全部楼层 |阅读模式
创建了一个最大/小化/可调整大小的窗口,并在上面创建了一个REBAR控件,但是当窗口被调整时,rebar中band的位置就发生了改变,帮助中几个例子也有此问题,但没有说明解决此问题的方法。试图在自定义函数wm_size中重新调整但没有找到类似于autosize的rebar函数,请问怎样设置rebar在窗口被调整时自动保留其原有位置或者不被重绘。谢!
#include <GuiRebar.au3>
#include <GuiToolbar.au3>
#include <GuiImageList.au3>

Global const $wm_size=0x0005
Global const $ccs_top = 0x1
Global const $ccs_noresize = 0x4
Global const $ccs_noparentalign = 0x8
Global const $ws_sizebox = 0x40000
Global const $ws_maximizebox = 0x10000
Global const $ws_minimizebox = 0x20000

Opt("GuiOnEventMode", 1)

$winStyle = BitOr($ws_sizebox, $ws_maximizebox, $ws_minimizebox)
$hGui = GuiCreate("rebar test", 400, 300, -1, -1, $winStyle)

Local $Icon[4] = [130, 132, 166, 131], $Img
$Img = _GuiImageList_Create(16, 16, 5, 3)
For $ele In $Icon
        _GuiImageList_AddIcon($Img, "shell32.dll", $ele)
Next

Local Enum $IdNew = 1000, $IdOpen, $IdSave, $IdExit
Local $string[4] = ["new", "open", "save", "exit"], $toolbar, $str[4]
$toolbarStyle = BitOr($tbstyle_flat, $ccs_noresize, $ccs_noparentalign)
$toolbar = _GuiCtrlToolbar_Create($hGui, $toolbarStyle)
_GuiCtrlToolbar_SetImageList($toolbar, $Img)
For $d = 0 to 3
        $str[$d] = _GuiCtrlToolbar_AddString($toolbar, $string[$d])
        _GuiCtrlToolbar_AddButton($toolbar, Eval("Id"&$string[$d]), $d, $str[$d])
Next

$progress = GuiCtrlCreateProgress(0, 0, 90, 20)
$hProgress = GuiCtrlGetHandle($progress)

$rebarStyle = BitOr($ccs_top, $rbs_varheight, $rbs_fixedorder)
$rebar = _GuiCtrlRebar_Create($hGui, $rebarStyle)

_GuiCtrlRebar_AddToolbarBand($rebar, $toolbar)
_GuiCtrlRebar_AddBand($rebar, $hProgress, 100, 130, "Progress:")

GuiSetState()
GuiSetOnEvent(-3, "_exit", $hGui)
GuiRegisterMsg($wm_size, "wm_size")

While 1
        sleep(2000)
WEnd

Func _exit()
        Exit(0)
EndFunc        ;==>_exit()

Func wm_size($hwnd, $message, $wParam, $iParam)
        msgBox(0, '', 'resizing')
EndFunc        ;==>wm_size()


发表于 2009-10-14 15:30:17 | 显示全部楼层
$winStyle = BitOr($WS_CLIPCHILDREN,$ws_sizebox, $ws_maximizebox, $ws_minimizebox)
发表于 2009-10-14 16:21:09 | 显示全部楼层
不懂,只知道楼上的不符合要求应该
发表于 2009-10-14 16:21:32 | 显示全部楼层
本帖最后由 破帽遮颜 于 2009-10-14 16:22 编辑

$progress = GuiCtrlCreateProgress(0, 0, 90, 20)
GUICtrlSetResizing(-1, 512 + 32 + 2 + 1)

不知道这样行不行??如果需要不改变位置,512 + 32 + 2 + 1改成768试试看
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 19:46 , Processed in 0.078331 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表