trescon Posted October 18, 2012 Share Posted October 18, 2012 Good evening, I would need a little help. I need to create a Gui Tab with about eight Tab Item. Within each Tab I need to put several buttons and I would be able to scroll the Vertical Tab, you can? If you can give me an example? thanks Alberto P.S. : Sorry but I do not speak English and translate with google. Thank You Alberto --------------------------------------------------- I am translate with Google. Link to comment Share on other sites More sharing options...
water Posted October 18, 2012 Share Posted October 18, 2012 Haven't tried it myself but maybe this is what you need. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
funkey Posted October 19, 2012 Share Posted October 19, 2012 Something like this? expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_UseX64=n #include <Array.au3> #include <GUIImageList.au3> #include <GUIListView.au3> #include <WindowsConstants.au3> Global $hListView Global $iItems = Random(3, 20, 1), $iItemSelection = Random(0, $iItems - 1, 1), $iItemSelection_Old = $iItemSelection Global $aListViewItem[$iItems], $aChildGUI[$iItems] _main() Func _main() Local $hGUI = GUICreate("Vertical ListView Tab", 600, 500) Local $iListView = GUICtrlCreateListView("", 8, 8, 135, 484, -1, $LVS_EX_SUBITEMIMAGES) $hListView = GUICtrlGetHandle(-1) Local $hImageList = _GUIImageList_Create(32, 32, 5, 3) For $A = 1 To $iItems _GUIImageList_AddIcon($hImageList, @SystemDir & "shell32.dll", Random(1, 200, 1), 1) Next _GUICtrlListView_SetImageList($hListView, $hImageList, 0) For $A = 0 To $iItems - 1 $aListViewItem[$A] = GUICtrlCreateListViewItem("Tab description " & $A, $iListView) _GUICtrlListView_SetItemImage($hListView, $A, $A) $aChildGUI[$A] = GUICreate("Child" & $A, 440, 484, 150, 8, $WS_CHILD, 0x00010000, $hGUI) GUISetBkColor(Random(0x111111, 0x999999, 1)) GUICtrlCreateButton("Button In Register " & $A, 20 + $A * 10, 20 + $A * 20, 200, 30) GUICtrlCreateButton("Button In Register " & $A, 20 + $A * 10, 50 + $A * 20, 200, 30) GUISetState(@SW_HIDE) Next _GUICtrlListView_SetView($hListView, 1) GUISetState(@SW_SHOW, $aChildGUI[$iItemSelection]) _GUICtrlListView_SetItemSelected($hListView, $iItemSelection, 1) _GUICtrlListView_EnsureVisible($hListView, $iItemSelection) GUISwitch($hGUI) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd EndFunc ;==>_Main Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) Local $idFrom = DllStructGetData($tNMHDR, "idFrom") Local $iCode = DllStructGetData($tNMHDR, "Code") If $hWndFrom = $hListView Then Switch $iCode Case -101 $iItemSelection = _ArraySearch($aListViewItem, GUICtrlRead($idFrom)) If $iItemSelection >= 0 And $iItemSelection_Old <> $iItemSelection Then GUISetState(@SW_SHOW, $aChildGUI[$iItemSelection]) GUISetState(@SW_HIDE, $aChildGUI[$iItemSelection_Old]) $iItemSelection_Old = $iItemSelection EndIf EndSwitch EndIf Return "GUI_RUNDEFMSG" EndFunc ;==>WM_NOTIFY Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 19, 2012 Moderators Share Posted October 19, 2012 trescon, Or this perhaps? expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIScrollBars_Ex.au3> Global $aChild[8], $aButton[8][5] ; Create GUI $hGUI_Main = GUICreate("Test", 500, 500) ; Create tabs $cTab = GUICtrlCreateTab(50, 30, 380, 300) For $i = 0 To 7 GUICtrlCreateTabItem("Tab " & $i) Next GUICtrlCreateTabItem("") ; Create child GUIs For $i = 0 To 7 $aChild[$i] = GUICreate("", 200, 150, 100, 100, $WS_POPUP, $WS_EX_MDICHILD, $hGUI_Main) GUISetBkColor(0xC4C4C4) ; Add controls For $j = 0 To 4 $aButton[$i][$j] = GUICtrlCreateButton("Button " & $i & $j, 10, 10 + (50 * $j), 80, 30) Next ; Create scrollbars _GUIScrollBars_Generate($aChild[$i], 0, 240) GUISetState(@SW_HIDE, $aChild[0]) Next ; Show GUIs GUISetState(@SW_SHOW, $aChild[0]) GUISetState(@SW_SHOW, $hGUI_Main) ; Set current tab value $iLastTab = 0 While 1 $nMsg = GUIGetMsg() If $nMsg Then ConsoleWrite($nMsg & @CRLF) Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $cTab ; Check which tab is active $iCurrTab = GUICtrlRead($cTab) ; If the tab has changed If $iCurrTab <> $iLastTab Then ; Hide child GUIs GUISetState(@SW_HIDE, $aChild[$iLastTab]) ; Show relevant GUI GUISetState(@SW_SHOW, $aChild[$iCurrTab]) ; Set new current tab $iLastTab = $iCurrTab EndIf Case Else ; Look for a button For $i = 0 To 7 For $j = 0 To 4 If $nMsg = $aButton[$i][$j] Then MsgBox(0, "Pressed", "Button " & $i & $j) EndIf Next Next EndSwitch WEnd Is that what you wanted? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
trescon Posted October 19, 2012 Author Share Posted October 19, 2012 Thank you all for the suggestions, all three are beautiful and interesting. Since I'm fairly new to the language Autoit I will serve as a study. Thanks to everyone really. Alberto translation by google Thank You Alberto --------------------------------------------------- I am translate with Google. 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