在Tab控件下绘制了一个Graphic图形,为什么不显示?【已解决】
本帖最后由 dreamneo 于 2013-6-5 16:47 编辑在Form窗体下绘制就没有问题,在Tab控件下为什么就没有显示啊?
代码如下:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 444, 192, 124)
$Tab1 = GUICtrlCreateTab(8, 8, 457, 337)
GUICtrlCreateTabItem("列表信息")
GUICtrlCreateTabItem("图形信息")
$Graphic1 = GUICtrlCreateGraphic(24, 32, 425, 289)
GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 96, 66, 218, 214)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
在 TAB 之前创建 Graphic,并依需要设置其初始显隐状态
在点击 TAB 时控制 Graphic ,设置其显隐状态 回复 2# afan
非常感谢,实现了!#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 444, 192, 124)
$Graphic1 = GUICtrlCreateGraphic(24, 32, 425, 289)
GUICtrlSetGraphic($Graphic1, $GUI_GR_ELLIPSE, 96, 66, 218, 214)
GUICtrlSetState($Graphic1,$GUI_HIDE)
$Tab = GUICtrlCreateTab(8, 8, 457, 337)
$Tab1 = GUICtrlCreateTabItem("列表信息")
$Tab2 = GUICtrlCreateTabItem("图形信息")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Tab
If GUICtrlRead($Tab) =1 Then
GUICtrlSetState($Graphic1,$GUI_SHOW)
Else
GUICtrlSetState($Graphic1,$GUI_HIDE)
EndIf
EndSwitch
WEnd
页:
[1]