tbaror Posted May 5, 2008 Share Posted May 5, 2008 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 More sharing options...
monoceres Posted May 5, 2008 Share Posted May 5, 2008 (edited) 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 May 5, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
rasim Posted May 6, 2008 Share Posted May 6, 2008 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 More sharing options...
monoceres Posted May 6, 2008 Share Posted May 6, 2008 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 More sharing options...
rasim Posted May 6, 2008 Share Posted May 6, 2008 Yes, you are right. Link to comment Share on other sites More sharing options...
tbaror Posted May 7, 2008 Author Share Posted May 7, 2008 thanks all its works Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now