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

[GUI管理] 【已解决】GUI中StatusBar如何跟着窗口一起放大缩小?

[复制链接]
发表于 2012-2-16 22:01:35 | 显示全部楼层 |阅读模式
本帖最后由 zerozha 于 2012-2-17 08:52 编辑
        $StatusBar1 = _GUICtrlStatusBar_Create($Main)
        Dim $StatusBar1_PartsWidth[2] = [500, -1]
        _GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)
        _GUICtrlStatusBar_SetText($StatusBar1, "数据库:" & $adSource, 0)
        _GUICtrlStatusBar_SetText($StatusBar1, @TAB & "共有  条记录", 1)
窗口中所有的控件都可以在窗体最大化后,自动伸展,就只有StatusBar不行,请问,该如何处理呢?

呵呵,感谢各位,已解决。代码如下:
        
;注册Windows消息函数
GUIRegisterMsg($WM_SIZE, "WM_SIZE")

;根据窗口大小,调整状态栏
Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam)
        #forceref $hWnd, $iMsg, $iwParam, $ilParam
        _GUICtrlStatusBar_Resize($StatusBar1)
        Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_SIZE
发表于 2012-2-16 22:15:45 | 显示全部楼层
这个没研究过,一直都是在做固定大小的窗口,可以先判断窗口宽度,然后根据宽度比例设置控件宽度。
发表于 2012-2-16 22:33:35 | 显示全部楼层
本帖最后由 afan 于 2012-2-16 22:35 编辑

注册 $WM_SIZE 消息,在该消息中 设置 $StatusBar1_PartsWidth 数组的值
_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)

如果状态栏简单,_GUICtrlStatusBar_Resize() 即可
发表于 2014-9-17 09:23:07 | 显示全部楼层
学习了!!!!!!!!!!!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-18 14:54 , Processed in 0.076646 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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