找回密码
 加入
搜索
查看: 2171|回复: 8

[网络通信] 【已解决】子窗口在调整分辨率后不跟随父窗口移动造成错位

[复制链接]
发表于 2019-8-10 10:45:17 | 显示全部楼层 |阅读模式
本帖最后由 itsky2 于 2019-8-10 16:06 编辑


如图,目前想到的办法是用选项卡,但是想要使用图片来切换,所以没用它。
希望各位大佬帮忙解答,谢谢!

问题已经解决!
方法:GUICreate("", 440, 320, 100, 35, $WS_CHILD, -1, $Form_Main)
必须将代码内的全部子窗口都如上法创建

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2019-8-10 15:16:38 | 显示全部楼层
#Region Form Main
Global $Form_Main = GUICreate("Easy IG", 550, 380, -1, -1, $WS_POPUP)
GUISetFont(10, 400, 0, "微软雅黑")
GUISetBkColor(0xFFFFFF)
GUICtrlCreateGraphic(0, 0, 1, 550)
GUICtrlSetBkColor(-1, 0x0078DD)
GUICtrlCreateGraphic(549, 0, 1, 550)
GUICtrlSetBkColor(-1, 0x0078DD)
GUICtrlCreateGraphic(0, 379, 550, 1)
GUICtrlSetBkColor(-1, 0x0078DD)
GUICtrlCreateGraphic(0, 0, 550, 1)
GUICtrlSetBkColor(-1, 0x0078DD)

GUICtrlCreateLabel('  Easy IG', 0, 0, 469, 28, $SS_CENTERIMAGE, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, 0x0078DD)
GUICtrlSetColor(-1, 0xFFFFFF)
Global $Close = GUICtrlCreateLabel('x', 509, 1, 40, 27, $SS_CENTER)
GUICtrlSetBkColor(-1, 0x0078DD)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 13)
Global $Min = GUICtrlCreateLabel('-', 469, 1, 40, 27, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetBkColor(-1, 0x0078DD)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")

Global $Tab_Recover = GUICtrlCreatePic('', 1, 40, 100, 100)
Global $Tab_Backup = GUICtrlCreatePic('', 1, 140, 100, 100)
Global $Tab_More = GUICtrlCreatePic('', 1, 240, 100, 100)
_SetImgFromBin($Tab_Recover, $Recover_Checked)
_SetImgFromBin($Tab_Backup, $Backup_Unchecked)
_SetImgFromBin($Tab_More, $More_Unchecked)
#EndRegion Form Main

#Region Form Recover
Global $Form_Recover = GUICreate("", 440, 320, 100, 35, $WS_POPUP, $WS_EX_MDICHILD, $Form_Main)
GUISetFont(10, 400, 0, "微软雅黑")
GUISetBkColor(0xFFFFFF)

GUICtrlCreateLabel("恢复映像:", 9, 47)
GUICtrlSetColor(-1, 0x0078DD)
GUICtrlCreateLabel("映像索引:", 9, 90)
GUICtrlSetColor(-1, 0x0078DD)
GUICtrlCreateLabel("目标分区:", 9, 137)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("磁盘信息:", 9, 181)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("卷标:", 146, 137)
GUICtrlSetColor(-1, 0xFF0000)
Global $Label_DriveLabel = GUICtrlCreateLabel("", 183, 137, 70, 30, 0x0C)
GUICtrlSetColor(-1, 0x0078DD)
GUICtrlCreateLabel("容量:", 255, 137)
GUICtrlSetColor(-1, 0xFF0000)
Global $Label_DriveSpaceTotal = GUICtrlCreateLabel("", 295, 137, 70, 30, 0x0C)
GUICtrlSetColor(-1, 0x0078DD)
Global $Label_DriveInfo = GUICtrlCreateLabel("", 80, 181, 300, 30, 0x0C)
GUICtrlSetColor(-1, 0x0078DD)

Global $ComboBox_RecoverImagePath = GUICtrlCreateCombo("", 82, 45, 310, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE))
Global $ComboBox_ImageIndex = GUICtrlCreateCombo("", 82, 87, 310, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE))
GUICtrlSetState($ComboBox_ImageIndex, $GUI_DISABLE)
Global $ComboBox_RecoverPartition = GUICtrlCreateCombo("", 82, 135, 50, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE, $CBS_UPPERCASE))

Global $Checkbox_Re_Restart = GUICtrlCreateCheckbox("自动重启计算机", 17, 229, 113, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
Global $Checkbox_Re_FormatDestination = GUICtrlCreateCheckbox("格式化目标分区", 152, 229, 113, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
Global $Checkbox_Re_RebuildBoot = GUICtrlCreateCheckbox("尝试重建系统引导", 285, 229, 129, 17)
GUICtrlSetState(-1, $GUI_CHECKED)

Global $Button_BrowseFiles = GUICtrlCreateButton(". . .", 402, 45, 30, 25)
GUICtrlSetTip(-1, '选择映像文件')
Global $Button_StartRecovering = GUICtrlCreateButton("开始恢复", 140, 265, 150, 35)
GUICtrlSetColor(-1, 0x0078DD)
GUICtrlSetBkColor(-1, 0xFFFFFF)
#EndRegion Form Recover

发表于 2019-8-10 11:55:45 | 显示全部楼层
代码发上来
发表于 2019-8-10 12:04:44 | 显示全部楼层
子窗口用内嵌样式  不要用弹出样式
 楼主| 发表于 2019-8-10 14:49:42 | 显示全部楼层
afan 发表于 2019-8-10 12:04
子窗口用内嵌样式  不要用弹出样式

非常感谢A大回复!
内嵌样式具体指?是WS_CHILD吗?但是一移动就消失了...这是原来的代码:GUICreate("", 440, 320, 100, 35, $WS_POPUP, $WS_EX_MDICHILD, $Form_Main)
发表于 2019-8-10 18:24:24 | 显示全部楼层
GUIRegisterMsg(126, 'WM_DISPLAYCHANGE')
Func WM_DISPLAYCHANGE($hwnd, $msg, $wparam, $lparam)
        Local $array=WinGetPos($Form_Main)
        WinMove( $Form_Recover,'',$array[0] +100 , $array[1] + 35)
EndFunc   ;==>WM_DISPLAYCHANGE
 楼主| 发表于 2019-8-10 21:12:37 | 显示全部楼层
haijie1223 发表于 2019-8-10 18:24
GUIRegisterMsg(126, 'WM_DISPLAYCHANGE')
Func WM_DISPLAYCHANGE($hwnd, $msg, $wparam, $lparam)
        Loc ...

谢谢大佬!貌似看不懂...
如果WS_CHILD解决了,就不用注册消息了...
发表于 2019-8-11 14:54:03 | 显示全部楼层
不错支持一下
发表于 2019-8-16 01:37:40 | 显示全部楼层
不错支持一下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-16 09:32 , Processed in 0.073102 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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