找回密码
 加入
搜索
查看: 2131|回复: 2

[GUI管理] 在Tab控件下绘制了一个Graphic图形,为什么不显示?【已解决】

[复制链接]
发表于 2013-6-5 12:13:10 | 显示全部楼层 |阅读模式
本帖最后由 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
发表于 2013-6-5 12:50:59 | 显示全部楼层
在 TAB 之前创建 Graphic,并依需要设置其初始显隐状态
在点击 TAB 时控制 Graphic ,设置其显隐状态
 楼主| 发表于 2013-6-5 16:35:39 | 显示全部楼层
回复 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
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-7 17:50 , Processed in 0.095967 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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