Page 1 of 1

使用Tab2,切换标签后显示不全怎么办?

Posted: 04 Jun 2015, 03:57
by youwantme
如图:我在New标签放了一个ActiveX的IE控件,访问百度。然后切换到General标签,再切换回来New时,显示不全,要鼠标晃半天才能显示出来。
请问怎么破?

Code: Select all

gui,new
Gui, Add, Button, x1200 yp w40 Default, 后退
Gui, Add, Button, x1260 yp w40 Default, 前进
Gui, Add, Button, x1200 y+15 w120 Default, 浏览
Gui, Add, Tab2,x0 y0, General|New  ;添加页框架,包含两页
Gui,Tab,General ;对第一页进行设置
Gui, Add, ActiveX, w1280 h700 vWB, Shell.Explorer ;把浏览器添加到第一页
Gui,Tab,New
Gui, Add, ActiveX, w1280 h700 vWB2, Shell.Explorer
Gui,Show
WB.Navigate("http://www.sohu.com") 
Return

Button前进:
wb.GoForward()
Return

Button后退:
wb.Goback()
Return

Button浏览:
WB2.Navigate("http://www.baidu.com")
Return
Image

Re: 使用Tab2,切换标签后显示不全怎么办?

Posted: 04 Jun 2015, 06:53
by tmplinshi
加上这个函数。

Code: Select all

DisableSetRedraw() {
    static _ := OnMessage(0x0B, "DisableSetRedraw") ; WM_SETREDRAW = 0x0B
    return 0
}

Re: 使用Tab2,切换标签后显示不全怎么办?

Posted: 04 Jun 2015, 13:55
by garry
thank you , I tried this with mozilla , maybe can be modified

Code: Select all

;-------- http://ahkscript.org/boards/viewtopic.php?f=27&t=8012 ---
f1:="http://ahkscript.org/boards/index.php"
f2:="http://www.timeanddate.com/"
;xxa=Shell.Explorer
xxa=Mozilla.Browser

gui,new
Gui, Add, Button, x1200 yp w40    gA1 , <
Gui, Add, Button, x1260 yp w40    gA2 , >
Gui, Add, Tab2,x0 y0 gTabchange vTabnumber, General|New
Gui,Tab,General
Gui, Add, ActiveX, w1280 h700 vWB1, %xxa%
Gui,Tab,New
Gui, Add, ActiveX, w1280 h700 vWB2, %xxa%
Gui,Show
WB1.Navigate(f1)
WB2.Navigate(f2)
Return

Guiclose:
exitapp

A1:
if (Tabnumber="General")
   wb1.GoBack()
if (Tabnumber="New")
   wb2.GoBack()
Return

A2:
if (Tabnumber="General")
   wb1.GoForward()
if (Tabnumber="New")
   wb2.GoForward()
Return


Tabchange:
GuiControlGet, TabNumber
Return
;-----------------------

DisableSetRedraw() {
    static _ := OnMessage(0x0B, "DisableSetRedraw") ; WM_SETREDRAW = 0x0B
    return 0
}
;========================================================================

Re: 使用Tab2,切换标签后显示不全怎么办?

Posted: 04 Jun 2015, 20:10
by youwantme
很好很神奇,哈哈。太感谢了!
tmplinshi wrote:加上这个函数。

Code: Select all

DisableSetRedraw() {
    static _ := OnMessage(0x0B, "DisableSetRedraw") ; WM_SETREDRAW = 0x0B
    return 0
}