Jump to content

Gui with tab scroll vertical


trescon
 Share

Recommended Posts

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

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Something like this?

#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 to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Link to comment
Share on other sites

  • Moderators

trescon,

Or this perhaps? :)

#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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

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...