keen Posted August 18, 2006 Share Posted August 18, 2006 How do you make a button on a gui that when you press it it will create another tab? [center]Kesne's Bar & Grill[/center] Link to comment Share on other sites More sharing options...
lod3n Posted August 18, 2006 Share Posted August 18, 2006 Like this: #include <GUIConstants.au3> #include <GuiTab.au3> global $tabcount = 1 dim $aTabs[1] $gui = GUICreate ( "Add Tabs GUI", 800,600,-1,-1, $WS_MAXIMIZE+$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) $size = WinGetClientSize($gui) $Button = GUICtrlCreateButton ("Add Tab", 10, 10, 100) $tab=GUICtrlCreateTab (3,60, $size[0]-6,$size[1]-6-60) GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) addtab() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button addtab() EndSelect Wend func addtab() redim $aTabs[$tabcount] $aTabs[$tabcount-1] = GUICtrlCreateTabitem ("Tab "&$tabcount) GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) GUICtrlSetStyle(-1,$WS_VISIBLE) GUICtrlCreateTabitem (""); end tabitem definition $tabcount += 1 EndFunc [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
keen Posted August 18, 2006 Author Share Posted August 18, 2006 I want the text and labels the same on every tab. How do i change whats on the tab? [center]Kesne's Bar & Grill[/center] Link to comment Share on other sites More sharing options...
keen Posted August 18, 2006 Author Share Posted August 18, 2006 Sorrybut i really need this fast. [center]Kesne's Bar & Grill[/center] Link to comment Share on other sites More sharing options...
Valuater Posted August 18, 2006 Share Posted August 18, 2006 I want the text and labels the same on every tab. How do i change whats on the tab?maybe if you added a thank you... or that helped alotyou would recieve more helpbut... no, you just want more without even comending lod3n 8) Link to comment Share on other sites More sharing options...
keen Posted August 18, 2006 Author Share Posted August 18, 2006 Sorry. The code works. Its very nice thank you. When i make a new tab it is just blank. How do i change the content on the tabs that are being created. [center]Kesne's Bar & Grill[/center] Link to comment Share on other sites More sharing options...
Valuater Posted August 18, 2006 Share Posted August 18, 2006 maybe... expandcollapse popup#include <GUIConstants.au3> #include <GuiTab.au3> global $tabcount = 1 dim $aTabs[1] $gui = GUICreate ( "Add Tabs GUI", 800,600,-1,-1, $WS_MAXIMIZE+$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) $size = WinGetClientSize($gui) $Button = GUICtrlCreateButton ("Add Tab", 10, 10, 100) $tab=GUICtrlCreateTab (3,60, $size[0]-6,$size[1]-6-60) GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) addtab() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button addtab() EndSelect Wend func addtab() redim $aTabs[$tabcount] $aTabs[$tabcount-1] = GUICtrlCreateTabitem ("Tab_"&$tabcount) GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) GUICtrlSetStyle(-1,$WS_VISIBLE) Call("Tab_"&$tabcount) GUICtrlCreateTabitem (""); end tabitem definition $tabcount += 1 EndFunc Func Tab_1() $Button1 = GUICtrlCreateButton ("Test #1", 200, 200, 100, 20) ; add other stuff EndFunc Func Tab_2() $Button2 = GUICtrlCreateButton ("Test #2", 200, 200, 100, 20) ; add other stuff EndFunc Func Tab_3() $label3 = GUICtrlCreateLabel ("Last Example Test #3", 200, 200, 200, 20) EndFunc 8) Link to comment Share on other sites More sharing options...
keen Posted August 18, 2006 Author Share Posted August 18, 2006 Thanks but i dont need cutom stuff for every tab. It can be the same for every tab. How can i make every tab display the same stuff? [center]Kesne's Bar & Grill[/center] Link to comment Share on other sites More sharing options...
Valuater Posted August 18, 2006 Share Posted August 18, 2006 (edited) Thanks but i dont need cutom stuff for every tab. It can be the same for every tab. How can i make every tab display the same stuff? func addtab() redim $aTabs[$tabcount] $aTabs[$tabcount-1] = GUICtrlCreateTabitem ("Tab_"&$tabcount) GUICtrlSetResizing (-1,$GUI_DOCKMENUBAR+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) GUICtrlSetStyle(-1,$WS_VISIBLE) ; ********** Add Stuff ***************** ; ********** End Add Stuff ******************* GUICtrlCreateTabitem (""); end tabitem definition $tabcount += 1 EndFunc and remove the func Tab_# above ( from the last script i wrote ) 8) Edited August 18, 2006 by Valuater Link to comment Share on other sites More sharing options...
keen Posted August 20, 2006 Author Share Posted August 20, 2006 (edited) Thanks! EDIT: I just noticed someting. I need an embedded IE in it. Can you help me do that? Edited August 20, 2006 by keen [center]Kesne's Bar & Grill[/center] Link to comment Share on other sites More sharing options...
keen Posted August 20, 2006 Author Share Posted August 20, 2006 Sorry but i need this ASAP. [center]Kesne's Bar & Grill[/center] Link to comment Share on other sites More sharing options...
lod3n Posted August 21, 2006 Share Posted August 21, 2006 What are you trying to do, exactly? What is your intended final result? Are you incrementally building a new web browser via help comments on a web forum? For creating embedded browsers controls, take a look at _IECreateEmbedded in the help file. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
keen Posted August 21, 2006 Author Share Posted August 21, 2006 Well im kinda sorta making a new browser. I looked in the help files. And i did what they said but it wont work. [center]Kesne's Bar & Grill[/center] 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