Jump to content
Sign in to follow this  
tbaror

GUICtrlCreatePic wont show pic with tab form

Recommended Posts

tbaror

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

Share this post


Link to post
Share on other sites
monoceres

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!

Share this post


Link to post
Share on other sites
rasim

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

Share this post


Link to post
Share on other sites
monoceres

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!

Share this post


Link to post
Share on other sites
rasim

Yes, you are right. :)

Share this post


Link to post
Share on other sites
tbaror

thanks all its works

Share this post


Link to post
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
Sign in to follow this  

×