Jump to content

Vertical Scrollbars with GUIScrollbars_Ex.au3


jevon
 Share

Recommended Posts

I can speak only a little English!

So, the problem is : Why the MouseWheel of UDF works only for one child gui and only once?

Please help me! Thanks a lot!

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiScrollBars.au3>
#include <ScrollBarConstants.au3>
#include <SendMessage.au3>
Global $aSB_WindowInfo[1][8],$Form[6]
$hGUI = GUICreate("Test", 400, 300)
$button0 = GUICtrlCreateButton("  0  ",5,5)
$button1 = GUICtrlCreateButton("  1  ",5,35)
For $tabForm = 0 To 1
$Form[$tabForm] = GUICreate("",200, 100, 200, 200, BitOR($WS_CHILD, $WS_EX_TOPMOST), $WS_EX_WINDOWEDGE, $hGUI)
GUISetBkColor(0xF5F5F5,$Form[$tabForm]);F5F5F5
GUICtrlCreateLabel("Form " & $tabForm,20,20)
_GUIScrollbars_Generate($Form[$tabForm], 0, 200)
Next
; Generate scrollbars
GUISetState(@SW_SHOW,$Form[0])
GUISetState(@SW_SHOW,$hGUI)
$button = $Form[0]
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
  Case $button0
   GUISetState(@SW_HIDE,$button)
   GUISetState(@SW_SHOW,$Form[0])
   $button = $Form[0]
  Case $button1
   GUISetState(@SW_SHOW,$Form[1])
   GUISetState(@SW_HIDE,$button)
   $button = $Form[1]
    EndSwitch
WEnd
Func _GUIScrollbars_Generate($hWnd, $iH_Scroll = 0, $iV_Scroll = 0, $iH_Tight = 0, $iV_Tight = 0, $fBefore = False)
    ; Check if valid window handle
    If Not IsHWnd($hWnd) Then Return SetError(1, 0, 0)
    If $aSB_WindowInfo[0][0] <> "" Then ReDim $aSB_WindowInfo[UBound($aSB_WindowInfo) + 1][8]
    ; If no scroll sizes set, return error
    If $iH_Scroll = 0 And $iV_Scroll = 0 Then Return SetError(2, 0, 0)
    ; Confirm Tight values
    If $iH_Tight <> 0 Then $iH_Tight = 1
    If $iV_Tight <> 0 Then $iV_Tight = 1
    ; Create structs
    Local $tTEXTMETRIC = DllStructCreate($tagTEXTMETRIC)
    Local $tSCROLLINFO = DllStructCreate($tagSCROLLINFO)
    DllStructSetData($tSCROLLINFO, "cbSize", DllStructGetSize($tSCROLLINFO))
    Local $tRect = DllStructCreate($tagRECT)
    ; Declare local variables
    Local $iIndex = UBound($aSB_WindowInfo) - 1
    Local $iError, $iExtended
    ; Save window handle
    $aSB_WindowInfo[$iIndex][0] = $hWnd
    ; Determine text size
    Local $hDC = DllCall("user32.dll", "handle", "GetDC", "hwnd", $hWnd)
    If Not @error Then
        $hDC = $hDC[0]
        DllCall("gdi32.dll", "bool", "GetTextMetricsW", "handle", $hDC, "ptr", DllStructGetPtr($tTEXTMETRIC))
        If @error Then
            $iError = @error
            $iExtended = @extended
            DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "handle", $hDC)
            Return SetError($iError, $iExtended, -2)
        EndIf
        DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "handle", $hDC)
    Else
        Return SetError(@error, @extended, -1)
    EndIf
    $aSB_WindowInfo[$iIndex][2] = DllStructGetData($tTEXTMETRIC, "tmAveCharWidth")
    $aSB_WindowInfo[$iIndex][3] = DllStructGetData($tTEXTMETRIC, "tmHeight") + DllStructGetData($tTEXTMETRIC, "tmExternalLeading")
    ; Size aperture window without bars
    DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $hWnd, "ptr", DllStructGetPtr($tRect))
    If @error Then Return SetError(@error, @extended, -3)
    Local $iX_Client_Full = DllStructGetData($tRect, "Right") - DllStructGetData($tRect, "Left")
    Local $iY_Client_Full = DllStructGetData($tRect, "Bottom") - DllStructGetData($tRect, "Top")
    $aSB_WindowInfo[$iIndex][4] = $iX_Client_Full
    $aSB_WindowInfo[$iIndex][5] = $iY_Client_Full
    ; Register scrollbar and mousewheel messages
    GUIRegisterMsg($WM_VSCROLL, "_Scrollbars_WM_VSCROLL")
    GUIRegisterMsg($WM_HSCROLL, "_Scrollbars_WM_HSCROLL")
    GUIRegisterMsg($WM_MOUSEWHEEL, "_Scrollbars_WM_MOUSEWHEEL")
    GUIRegisterMsg($WM_MOUSEHWHEEL, '_Scrollbars_WM_MOUSEHWHEEL')
    ; Show scrollbars
    _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, False)
    If $iH_Scroll Then _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ)
    If $iV_Scroll Then _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT)
    ; Size aperture window with bars
    DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $hWnd, "ptr", DllStructGetPtr($tRect))
    If @error Then Return SetError(@error, @extended, -3)
    Local $iX_Client_Bar = DllStructGetData($tRect, "Right") - DllStructGetData($tRect, "Left")
    Local $iY_Client_Bar = DllStructGetData($tRect, "Bottom") - DllStructGetData($tRect, "Top")
    ; If horizontal scrollbar is required
    Local $iH_FullPage
    If $iH_Scroll Then
        If $fBefore Then
            ; Use actual aperture width
            $aSB_WindowInfo[$iIndex][4] = $iX_Client_Bar
            ; Determine page size (aperture width / text width)
            $iH_FullPage = Floor($aSB_WindowInfo[$iIndex][4] / $aSB_WindowInfo[$iIndex][2])
            ; Determine max size (scroll width / text width - tight)
            $aSB_WindowInfo[$iIndex][6] = Floor($iH_Scroll / $aSB_WindowInfo[$iIndex][2]) - $iH_Tight
        Else
            ; Use reduced aperture width only if other scrollbar exists
            If $iV_Scroll Then $aSB_WindowInfo[$iIndex][4] = $iX_Client_Bar
            ; Determine page size (aperture width / text width)
            $iH_FullPage = Floor($aSB_WindowInfo[$iIndex][4] / $aSB_WindowInfo[$iIndex][2])
            ; Determine max size (scroll width / text width * correction factor for V scrollbar if required - tight)
            $aSB_WindowInfo[$iIndex][6] = Floor($iH_Scroll / $aSB_WindowInfo[$iIndex][2] * $aSB_WindowInfo[$iIndex][4] / $iX_Client_Full) - $iH_Tight
        EndIf
    Else
        $aSB_WindowInfo[$iIndex][6] = 0
    EndIf
    ; If vertical scrollbar required
    Local $iV_FullPage
    If $iV_Scroll Then
        If $fBefore Then
            ; Use actual aperture height
            $aSB_WindowInfo[$iIndex][5] = $iY_Client_Bar
            ; Determine page size (aperture width / text width)
            $iV_FullPage = Floor($aSB_WindowInfo[$iIndex][5] / $aSB_WindowInfo[$iIndex][3])
            ; Determine max size (scroll width / text width - tight)
            $aSB_WindowInfo[$iIndex][7] = Floor($iV_Scroll / $aSB_WindowInfo[$iIndex][3]) - $iV_Tight
        Else
            ; Use reduced aperture width only if other scrollbar exists
            If $iH_Scroll Then $aSB_WindowInfo[$iIndex][5] = $iY_Client_Bar
            ; Determine page size (aperture width / text width)
            $iV_FullPage = Floor($aSB_WindowInfo[$iIndex][5] / $aSB_WindowInfo[$iIndex][3])
            ; Determine max size (scroll width / text width * correction factor for H scrollbar if required - tight)
            $aSB_WindowInfo[$iIndex][7] = Floor($iV_Scroll / $aSB_WindowInfo[$iIndex][3] * $aSB_WindowInfo[$iIndex][5] / $iY_Client_Full) - $iV_Tight
        EndIf
    Else
        $aSB_WindowInfo[$iIndex][7] = 0
    EndIf
    Local $aRet[4]
    If $iV_Scroll Then
        $aRet[0] = $iX_Client_Bar
    Else
        $aRet[0] = $iX_Client_Full
    EndIf
    If $iH_Scroll Then
        $aRet[1] = $iY_Client_Bar
    Else
        $aRet[1] = $iY_Client_Full
    EndIf
    $aRet[2] = $iX_Client_Bar / $iX_Client_Full
    $aRet[3] = $iY_Client_Bar / $iY_Client_Full
    Local $fSuccess = True
    If _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, False) = False Then $fSuccess = False
    If $iH_Scroll Then
        If _GUIScrollBars_SetScrollInfoMax($hWnd, $SB_HORZ, $aSB_WindowInfo[$iIndex][6]) = False Then $fSuccess = False
        _GUIScrollBars_SetScrollInfoPage($hWnd, $SB_HORZ, $iH_FullPage)
        If @error Then $fSuccess = False
        If _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ, True) = False Then $fSuccess = False
    Else
        If _GUIScrollBars_ShowScrollBar($hWnd, $SB_HORZ, False) = False Then $fSuccess = False
    EndIf
    If $iV_Scroll Then
        If _GUIScrollBars_SetScrollInfoMax($hWnd, $SB_VERT, $aSB_WindowInfo[$iIndex][7]) = False Then $fSuccess = False
        _GUIScrollBars_SetScrollInfoPage($hWnd, $SB_VERT, $iV_FullPage)
        If @error Then $fSuccess = False
        If _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT, True) = False Then $fSuccess = False
    Else
        If _GUIScrollBars_ShowScrollBar($hWnd, $SB_VERT, False) = False Then $fSuccess = False
    EndIf
    If $fSuccess Then Return $aRet
    Return SetError(3, 0, 0)
EndFunc   ;==>_GUIScrollbars_Generate
Func _Scrollbars_WM_VSCROLL($hWnd, $Msg, $wParam, $lParam)
    #forceref $Msg, $wParam, $lParam
    Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
    Local $iIndex = -1, $yChar, $yPos
    Local $Min, $Max, $Page, $Pos, $TrackPos
    For $x = 0 To UBound($aSB_WindowInfo) - 1
        If $aSB_WindowInfo[$x][0] = $hWnd Then
            $iIndex = $x
            $yChar = $aSB_WindowInfo[$iIndex][3]
            ExitLoop
        EndIf
    Next
    If $iIndex = -1 Then Return 0
    Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT)
    $Min = DllStructGetData($tSCROLLINFO, "nMin")
    $Max = DllStructGetData($tSCROLLINFO, "nMax")
    $Page = DllStructGetData($tSCROLLINFO, "nPage")
    $yPos = DllStructGetData($tSCROLLINFO, "nPos")
    $Pos = $yPos
    $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos")
    Switch $nScrollCode
        Case $SB_TOP
            DllStructSetData($tSCROLLINFO, "nPos", $Min)
        Case $SB_BOTTOM
            DllStructSetData($tSCROLLINFO, "nPos", $Max)
        Case $SB_LINEUP
            DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1)
        Case $SB_LINEDOWN
            DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1)
        Case $SB_PAGEUP
            DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page)
        Case $SB_PAGEDOWN
            DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page)
        Case $SB_THUMBTRACK
            DllStructSetData($tSCROLLINFO, "nPos", $TrackPos)
    EndSwitch
    DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS)
    _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
    _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
    $Pos = DllStructGetData($tSCROLLINFO, "nPos")
    If ($Pos <> $yPos) Then
        _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos))
        $yPos = $Pos
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_Scrollbars_WM_VSCROLL
Func _Scrollbars_WM_HSCROLL($hWnd, $Msg, $wParam, $lParam)
    #forceref $Msg, $lParam
    Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
    Local $iIndex = -1, $xChar, $xPos
    Local $Page, $Pos, $TrackPos
    For $x = 0 To UBound($aSB_WindowInfo) - 1
        If $aSB_WindowInfo[$x][0] = $hWnd Then
            $iIndex = $x
            $xChar = $aSB_WindowInfo[$iIndex][2]
            ExitLoop
        EndIf
    Next
    If $iIndex = -1 Then Return 0
    Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ)
    $Page = DllStructGetData($tSCROLLINFO, "nPage")
    $xPos = DllStructGetData($tSCROLLINFO, "nPos")
    $Pos = $xPos
    $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos")
    Switch $nScrollCode
        Case $SB_LINELEFT
            DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1)
        Case $SB_LINERIGHT
            DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1)
        Case $SB_PAGELEFT
            DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page)
        Case $SB_PAGERIGHT
            DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page)
        Case $SB_THUMBTRACK
            DllStructSetData($tSCROLLINFO, "nPos", $TrackPos)
    EndSwitch
    DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS)
    _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO)
    _GUIScrollBars_GetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO)
    $Pos = DllStructGetData($tSCROLLINFO, "nPos")
    If ($Pos <> $xPos) Then _GUIScrollBars_ScrollWindow($hWnd, $xChar * ($xPos - $Pos), 0)
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_Scrollbars_WM_HSCROLL
Func _Scrollbars_WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam)
    Local $iDirn, $iDelta = BitShift($wParam, 16)
    If BitAND($wParam, 0x0000FFFF) Then ; If Ctrl or Shft pressed move Horz scrollbar
        $iDirn = $SB_LINERIGHT
        If $iDelta > 0 Then $iDirn = $SB_LINELEFT
        For $i = 1 To 10
            _SendMessage($hWnd, $WM_HSCROLL, $iDirn)
        Next
    Else ; Move Vert scrollbar
        $iDirn = $SB_LINEDOWN
        If $iDelta > 0 Then $iDirn = $SB_LINEUP
        _SendMessage($hWnd, $WM_VSCROLL, $iDirn)
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_Scrollbars_WM_MOUSEWHEEL
Func _Scrollbars_WM_MOUSEHWHEEL($hWnd, $iMsg, $wParam, $lParam)
    Local $iDirn, $iDelta = BitShift($wParam, 16)
    Local $iDirn = $SB_LINERIGHT
    If $iDelta > 0 Then $iDirn = $SB_LINELEFT
    For $i = 1 To 10
        _SendMessage($hWnd, $WM_HSCROLL, $iDirn)
    Next
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_Scrollbars_WM_MOUSEHWHEEL
Edited by Melba23
Added code tags
Link to comment
Share on other sites

  • Moderators

jevon,

Welcome to the AutoIt forum. :)

The script works fine for me - the mouse button scrolls both GUIs:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiScrollBars_Ex.au3> ; Use the UDF as an include - that is why I wrote it <<<<<<<<<<<<<<<<
#include <ScrollBarConstants.au3>
#include <SendMessage.au3>

Global $Form[6]

$hGUI = GUICreate("Test", 400, 300)
$button0 = GUICtrlCreateButton("  0  ", 5, 5)
$button1 = GUICtrlCreateButton("  1  ", 5, 35)

For $tabForm = 0 To 1
    $Form[$tabForm] = GUICreate("", 200, 100, 200, 200, BitOR($WS_CHILD, $WS_EX_TOPMOST), $WS_EX_WINDOWEDGE, $hGUI)
    GUISetBkColor(0xF5F5F5, $Form[$tabForm])
    GUICtrlCreateLabel("Form " & $tabForm, 20, 20)
    _GUIScrollbars_Generate($Form[$tabForm], 0, 200)
Next

GUISetState(@SW_SHOW, $Form[0])
GUISetState(@SW_SHOW, $hGUI)

$button = $Form[0]

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button0
            GUISetState(@SW_HIDE, $button)
            GUISetState(@SW_SHOW, $Form[0])
            $button = $Form[0]
        Case $button1
            GUISetState(@SW_SHOW, $Form[1])
            GUISetState(@SW_HIDE, $button)
            $button = $Form[1]
    EndSwitch
WEnd

So for you it does not? :huh:

M23

P.S. When you post code, please use Code tags - put [autoit] before and [/autoit] after your posted code. I have done it for you above - you can see how much nicer it looks. ;)

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

@M23 in my computer not work. W7 64x my Autoit version 3.3.8.1 Edited by Danyfirex
Link to comment
Share on other sites

  • Moderators

jevon,

I use 3.3.8.1 (release) and 3.3.9.4 (beta) - on both I get the 2 GUIs to scroll without problem. I am using 32-bit Vista - are you using an x64 OS? :huh:

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

  • Moderators

jevon,

Can you scroll with the mouse when you run the example scripts that come with the UDF? :huh:

M23

Edited by Melba23
Added words

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

I am sorry for repling so late!because I make three topic per day only!

When I run the example scripts,it works fine for "Form 0".Then I click button 1 to show "Form 1".When I click the scrollbar or Paddling the touchpad of my notebook it works.But when I onmousewheel it does not work. And then I click button 0 to show "Form 0",it liks "Form 1".

I had try to fix it before,and I find out that if I set the child gui $WS_POPUP style. It work for all gui.

Lik this:

$Form[$tabForm] = GUICreate("",200, 100, 200, 200, BitOR($WS_POPUP, $WS_EX_MDICHILD), $WS_EX_WINDOWEDGE, $hGUI)------(Why I can not click AutoIt button?)

But it seems not so better then $WS_CHILD style! So I need $WS_CHILD style!

Jevon

Link to comment
Share on other sites

  • Moderators

jevon,

I am sorry for repling so late

No problem. :)

As to the problem, I have found that AutoIt sometimes has problems when using the $WS_CHILD style on multiple children. :(

See if this works any better for you:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiScrollBars_Ex.au3>
#include <ScrollBarConstants.au3>
#include <SendMessage.au3>
#include <WinAPI.au3> ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Global $Form[6]

$hGUI = GUICreate("Test", 400, 300)
$button0 = GUICtrlCreateButton("  0  ", 5, 5)
$button1 = GUICtrlCreateButton("  1  ", 5, 35)

For $tabForm = 0 To 1
    $Form[$tabForm] = GUICreate("", 200, 100, 200, 200, $WS_POPUP, $WS_EX_WINDOWEDGE, $hGUI)
    _WinAPI_SetParent($Form[$tabForm], $hGUI) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    GUISetBkColor(0xF5F5F5, $Form[$tabForm])
    GUICtrlCreateLabel("Form " & $tabForm, 20, 20)
    _GUIScrollbars_Generate($Form[$tabForm], 0, 200)
Next

GUISetState(@SW_SHOW, $Form[0])
GUISetState(@SW_SHOW, $hGUI)

$button = $Form[0]

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button0
            GUISetState(@SW_HIDE, $button)
            GUISetState(@SW_SHOW, $Form[0])
            $button = $Form[0]
        Case $button1
            GUISetState(@SW_SHOW, $Form[1])
            GUISetState(@SW_HIDE, $button)
            $button = $Form[1]
    EndSwitch
WEnd

Any better? :huh:

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

  • Moderators

jevon,

Glad we got there in the end! :)

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

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