Jump to content

GUICtrlCreatePic wont show pic with tab form


Recommended Posts

Hello,

i have a form that include tree tabsheet i would like to present a pic in the 1st tab but without success, the only way to do so it to add the GUICtrlCreatePic before the tabshhet creation but then the picture appear on all tabs.

is there other way to present pic on specific tab?

please advise

Thanks

Link to comment
Share on other sites

Use GUISwitch to switch which between items :)

Example:

Opt("GUIOnEventMode",1)
$parent=GUICreate("Hello",400,300)
$tab=GUICtrlCreateTab(10,10,380,280)
$titem1=GUICtrlCreateTabItem("Tab 1")
$titem2=GUICtrlCreateTabItem("Tab 2")
$titem3=GUICtrlCreateTabItem("Tab 3")
GuiCtrlCreateTabItem("")
GUISwitch($parent,$titem2)
GUICtrlCreatePic("3.bmp",15,40,100,100) ; Change to your picture
GUICtrlCreateTabItem("")
GUISwitch($parent)
GUISetOnEvent(-3,"close")
GUISetState()

while 1
    Sleep(100)
WEnd


Func close ()
    Exit
EndFunc
Edited by monoceres

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

I don`t understand, why need to use two switch?

Seem this work

Opt("GUIOnEventMode",1)

$parent=GUICreate("Hello",400,300)
GUISetOnEvent(-3,"close")

$tab=GUICtrlCreateTab(10,10,380,280)

$titem1=GUICtrlCreateTabItem("Tab 1")

$titem2=GUICtrlCreateTabItem("Tab 2")
GUICtrlCreatePic("test.gif",15,40,100,100) ; Change to your picture

$titem3=GUICtrlCreateTabItem("Tab 3")

GuiCtrlCreateTabItem("")

GUISetState()

while 1
    Sleep(100)
WEnd

Func close ()
    Exit
EndFunc
Link to comment
Share on other sites

I don`t understand, why need to use two switch?

Seem this work

Opt("GUIOnEventMode",1)

$parent=GUICreate("Hello",400,300)
GUISetOnEvent(-3,"close")

$tab=GUICtrlCreateTab(10,10,380,280)

$titem1=GUICtrlCreateTabItem("Tab 1")

$titem2=GUICtrlCreateTabItem("Tab 2")
GUICtrlCreatePic("test.gif",15,40,100,100) ; Change to your picture

$titem3=GUICtrlCreateTabItem("Tab 3")

GuiCtrlCreateTabItem("")

GUISetState()

while 1
    Sleep(100)
WEnd

Func close ()
    Exit
EndFunc
That works perfectly well if you never need to change your GUI, if you need to add controls after the creation of the tabs you will have to use GUISwitch().

:)

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...