Jump to content

Scroll Problem


Digisoul
 Share

Recommended Posts

Hello there,

I am trying to make a table like entry form, and totally stuck at scrolling.

here is my code:

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>
#include <WinAPI.au3>

Global $input_controlls[1][4], $iCnt = 0, $hEntryGUI, $entry_scroll = False, $NumOfInputs = 1, $LineIndex = 0, $EntryIndex = 0, $OPEN_INDEX, $checkNextEntry = False, $Y = 2, $hEGUI
Global $Entry_Height = 175
Global $user32 = DllOpen("user32.dll")
#region ### START Koda GUI section ### Form=
$hGUI = GUICreate("Form2", 625, 298, 193, 222)


$bUp = GUICtrlCreateButton(Chr("0xE1"), 555, 0, 20)
GUICtrlSetFont($bUp, Default, Default, Default, "Wingdings")
$bDown = GUICtrlCreateButton(Chr("0xE2"), 555, $Entry_Height - 23, 20)
GUICtrlSetFont($bDown, Default, Default, Default, "Wingdings")


$NEXT = GUICtrlCreateDummy()
$DOWN = GUICtrlCreateDummy()
$UP = GUICtrlCreateDummy()
$UP = GUICtrlCreateDummy()

$hEGUI = GUICreate("Entry Parrent Gui", 555, $Entry_Height, 0, 0, $WS_CHILD, -1, $hGUI)
GUISetState()
$hEntryGUI = GUICreate("Entry Gui", 555, $Entry_Height, 0, 0, $WS_CHILD, -1, $hEGUI)
GUISetBkColor(0X006400)



$yPos = _WinGetposIn($hEGUI, "", $hEntryGUI)
Global $default_pos = $yPos[1]


For $i = 0 To 6
    $input_controlls[$i][0] = GUICtrlCreateInput("LINE" & $i + 1, 0, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$i][1] = GUICtrlCreateInput("", 128, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$i][2] = GUICtrlCreateInput("", 256, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$i][3] = GUICtrlCreateInput("", 384, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    UpdateIndex($input_controlls)
    $Y += 25
Next

ConsoleWrite("Default Y Position: "&$default_pos&@CRLF)

GUISetState()
GUISwitch($hGUI)
GUISetState()

Dim $keys[3][2] = [["{ENTER}", $NEXT],["{DOWN}", $DOWN],["{UP}", $UP]]
GUISetAccelerators($keys, $hGUI)

#endregion ### END Koda GUI section ###
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
;GUIRegisterMsg($WM_SIZE, "WM_SIZE")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $NEXT
            If $checkNextEntry = True Then
                ;ConsoleWrite("Entry On: " & ($LineIndex + 1) & "==" & ($NumOfInputs - 1) & @CRLF)
                ;ConsoleWrite("Y:: " & $Y & "NEW y: " & ($Y + 30) & @CRLF)
                If ($LineIndex + 1) == ($NumOfInputs - 1) Then ; Last Line
                    ; New Line Entry
                    AddEntry(True, True)
                Else
                    ; Focus On The Next Line
                    GUISwitch($hEntryGUI)
                    GUICtrlSetState($input_controlls[$LineIndex + 1][0], $GUI_FOCUS)
                    ;_SetFocus(GUICtrlGetHandle($input_controlls[$LineIndex + 1][0]))

                    GUISwitch($hGUI)
                EndIf
            Else
                ;Focus on The Next Cell
                GUISwitch($hEntryGUI)
                ;_SetFocus(GUICtrlGetHandle($input_controlls[$LineIndex][$EntryIndex + 1]))
                GUICtrlSetState($input_controlls[$LineIndex][$EntryIndex + 1], $GUI_FOCUS)
                GUISwitch($hGUI)
            EndIf
        Case $DOWN
            ConsoleWrite("Down: " & $LineIndex & " " & $NumOfInputs - 1 & @CRLF)
            ConsoleWrite("Down: " & ($LineIndex <> ($NumOfInputs)) & @CRLF)
            If $LineIndex <> ($NumOfInputs) Then ; LAST lINE
                ConsoleWrite("+ Down" & @CRLF)
                GUISwitch($hEntryGUI)
                GUICtrlSetState($input_controlls[$LineIndex + 1][$EntryIndex], $GUI_FOCUS)
                GUISwitch($hGUI)
            EndIf
        Case $UP
            If $LineIndex <> 0 Then ;1st line
                GUISwitch($hEntryGUI)
                GUICtrlSetState($input_controlls[$LineIndex - 1][$EntryIndex], $GUI_FOCUS)
                GUISwitch($hGUI)
            EndIf
        Case $bDown
            scroll("down")
    EndSwitch

WEnd

Func UpdateIndex(ByRef $A, $DIM = 4)
    $p = UBound($A)
    ReDim $A[$p + 1][$DIM]
    $NumOfInputs = $p + 1
    ConsoleWrite("+ UPDATE Index: " & $NumOfInputs & @CRLF)
    Return $p - 1
EndFunc   ;==>UpdateIndex

Func AddEntry($Switch = True, $Focus = True)
    If $Switch Then GUISwitch($hEntryGUI)

    $uI = UpdateIndex($input_controlls)
    $OPEN_INDEX = $uI
    $input_controlls[$uI][0] = GUICtrlCreateInput("LINE:" & $uI + 1, 0, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$uI][1] = GUICtrlCreateInput("", 128, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$uI][2] = GUICtrlCreateInput("", 256, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$uI][3] = GUICtrlCreateInput("", 384, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $Y += 25

    If Check_Space($hEntryGUI) = True Then
        $Entry_Height += 35
        Local $lP = _WinGetposIn($hEGUI, "", $hEntryGUI)
        WinMove($hEntryGUI, "", $lP[0],$lP[1], Default, $Entry_Height) ; Resize

        Local $wPos = WinGetPos($hEntryGUI)
        ConsoleWrite("! After ReSize :: Win Height: " & $wPos[3] &" WinY: " & $wPos[1]& " CtrlY: " & $Y & " Result: " & ($Y > $wPos[3]) & @CRLF)
    EndIf

    If $Focus Then GUICtrlSetState($input_controlls[$LineIndex + 1][0], $GUI_FOCUS) ; fOCUS ON NEW LINE
    If $Switch Then GUISwitch($hGUI)
EndFunc   ;==>AddEntry

Func Check_Space($hWnd)
    Local $wPos = ControlGetPos($hEGUI,"",$hWnd)
    ConsoleWrite("! Before ReSize :: Win Height: " & $wPos[3] &" WinY: " & $wPos[1]& " CtrlY: " & $Y & " Result: " & ($Y > $wPos[3]) & @CRLF)
    If ($Y > $wPos[3]) Then
        Return True
    Else
        Return False
    EndIf
EndFunc   ;==>Check_Space

Func scroll($mode)
    Switch $mode
        Case "up"

        Case "down"
            Local $wPos = WinGetPos($hEntryGUI)

            Local $cP = _WinGetposIn($hEGUI, "", $hEntryGUI)
            ConsoleWrite("- Scrolling:: win x: " & $cP[0] & " win y:" &  $cP[1] & " scroll:"& $cP[1] - 22 & @CRLF)
            WinMove($hEntryGUI, "", $cP[0], $cP[1] - 21)

            Local $cPos = ControlGetPos($hEntryGUI, "", $input_controlls[$OPEN_INDEX][0])
            ConsoleWrite("- Calculated Possition : Win Y: " & $wPos[2] & " $Y:" & $Y & @CRLF)
    EndSwitch
EndFunc   ;==>scroll

Func _WinGetposIn($parentW, $parentText, $childW, $childText = "")
    Local $Result, $offset

    If Not WinExists($childW) Then Return SetError(1, 1, 0)
    If Not WinExists($parentW) Then Return SetError(1, 2, 0)

    If BitAND(WinGetState($childW), 16) Or BitAND(WinGetState($parentW), 16) Then Return SetError(1, 3, 0)

    $offset = DllStructCreate("int;int")
    DllCall("User32.dll", "int", "ClientToScreen", "hwnd", WinGetHandle($parentW, $parentText), "ptr", DllStructGetPtr($offset))
    If @error Then Return SetError(1, 4, 0)
    ;ConsoleWrite(DllStructGetData($offset, 1) & ', ' & DllStructGetData($offset, 2) & @CRLF)
    $Result = WinGetPos($childW, $childText)

    $Result[0] -= DllStructGetData($offset, 1)
    $Result[1] -= DllStructGetData($offset, 2)

    Return $Result
EndFunc   ;==>_WinGetposIn

Func ClientToScreen($hWnd, $x, $Y)
    Local $stPoint = DllStructCreate("int;int"), $Result[2]

    DllStructSetData($stPoint, 1, $x)
    DllStructSetData($stPoint, 2, $Y)

    DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

    $x = DllStructGetData($stPoint, 1)
    $Result[0] = $x
    $Y = DllStructGetData($stPoint, 2)
    $Result[1] = $Y
    ; release Struct not really needed as it is a local
    $stPoint = 0
    Return $Result
EndFunc   ;==>ClientToScreen

Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg
    Local $hWndFrom, $iIDFrom, $iCode, $hWndEdit
    ;If Not IsHWnd($hEdit) Then $hWndEdit = GUICtrlGetHandle($hEdit)
    $hWndFrom = $ilParam
    $iIDFrom = _WinAPI_LoWord($iwParam)
    $iCode = _WinAPI_HiWord($iwParam)
    Switch $hWnd
        Case $hEntryGUI
            Switch $iCode
                Case $EN_SETFOCUS
                    For $i = 0 To $NumOfInputs - 1
                        $handle1 = GUICtrlGetHandle($input_controlls[$i][0])
                        $handle2 = GUICtrlGetHandle($input_controlls[$i][1])
                        $handle3 = GUICtrlGetHandle($input_controlls[$i][2])
                        $handle4 = GUICtrlGetHandle($input_controlls[$i][3])
                        If $handle1 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 1" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 0
                            $checkNextEntry = False
                            ExitLoop
                        EndIf
                        If $handle2 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 2" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 1
                            $checkNextEntry = False
                            ExitLoop
                        EndIf
                        If $handle3 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 3" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 2
                            $checkNextEntry = False
                            ExitLoop
                        EndIf
                        If $handle4 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 4" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 3
                            $checkNextEntry = True
                        EndIf
                    Next
            EndSwitch

    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @LF & _
            "+======================================================" & @LF & _
            "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
            "+======================================================" & @LF)EndFunc   ;==>_DebugPrint

here is a example preview:

post-36752-12724453919208_thumb.jpg

when the user press enter at last Entry of Line 7 it will genrate a new line, but i am unable to controll its scroll position.

because if i press DOWN button twice it will show result like this:

post-36752-12724454688694_thumb.jpg

Thanks in Advance.

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

  • Moderators

Digisoul,

That was fun! :)

You were using several different values (21, 22, 25, 35) to vary the scroll distance and the GUI height when you added lines. Once those were standardised at 25, life became a bit easier. The scrolling now works as it should, and you cannot go past the beginning or end of the available lines. All you need to do when adding a line is call a "down" scroll - simple, eh :) :

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>
#include <WinAPI.au3>

Global $input_controlls[1][4], $iCnt = 0, $hEntryGUI, $entry_scroll = False, $NumOfInputs = 1, $LineIndex = 0, $EntryIndex = 0, $OPEN_INDEX, $checkNextEntry = False, $Y = 2, $hEGUI
Global $Entry_Height = 175
Global $user32 = DllOpen("user32.dll")
#region ### START Koda GUI section ### Form=
$hGUI = GUICreate("Form2", 625, 298, 193, 222)


$bUp = GUICtrlCreateButton(Chr("0xE1"), 555, 0, 20)
GUICtrlSetFont($bUp, Default, Default, Default, "Wingdings")
$bDown = GUICtrlCreateButton(Chr("0xE2"), 555, $Entry_Height - 23, 20)
GUICtrlSetFont($bDown, Default, Default, Default, "Wingdings")


$NEXT = GUICtrlCreateDummy()
$DOWN = GUICtrlCreateDummy()
$UP = GUICtrlCreateDummy()
$UP = GUICtrlCreateDummy()

$hEGUI = GUICreate("Entry Parrent Gui", 555, $Entry_Height, 0, 0, $WS_CHILD, -1, $hGUI)
GUISetState()
$hEntryGUI = GUICreate("Entry Gui", 555, $Entry_Height, 0, 0, $WS_CHILD, -1, $hEGUI)
GUISetBkColor(0X006400)



$yPos = _WinGetposIn($hEGUI, "", $hEntryGUI)
Global $default_pos = $yPos[1]


For $i = 0 To 6
    $input_controlls[$i][0] = GUICtrlCreateInput("LINE" & $i + 1, 0, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$i][1] = GUICtrlCreateInput("", 128, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$i][2] = GUICtrlCreateInput("", 256, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$i][3] = GUICtrlCreateInput("", 384, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    UpdateIndex($input_controlls)
    $Y += 25
Next

ConsoleWrite("Default Y Position: "&$default_pos&@CRLF)

GUISetState()
GUISwitch($hGUI)
GUISetState()

Dim $keys[3][2] = [["{ENTER}", $NEXT],["{DOWN}", $DOWN],["{UP}", $UP]]
GUISetAccelerators($keys, $hGUI)

#endregion ### END Koda GUI section ###
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
;GUIRegisterMsg($WM_SIZE, "WM_SIZE")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $NEXT
            If $checkNextEntry = True Then
                ;ConsoleWrite("Entry On: " & ($LineIndex + 1) & "==" & ($NumOfInputs - 1) & @CRLF)
                ;ConsoleWrite("Y:: " & $Y & "NEW y: " & ($Y + 30) & @CRLF)
                If ($LineIndex + 1) == ($NumOfInputs - 1) Then ; Last Line
                    ; New Line Entry
                    AddEntry(True, True)
                    scroll("down")
                Else
                    ; Focus On The Next Line
                    GUISwitch($hEntryGUI)
                    GUICtrlSetState($input_controlls[$LineIndex + 1][0], $GUI_FOCUS)
                    ;_SetFocus(GUICtrlGetHandle($input_controlls[$LineIndex + 1][0]))

                    GUISwitch($hGUI)
                EndIf
            Else
                ;Focus on The Next Cell
                GUISwitch($hEntryGUI)
                ;_SetFocus(GUICtrlGetHandle($input_controlls[$LineIndex][$EntryIndex + 1]))
                GUICtrlSetState($input_controlls[$LineIndex][$EntryIndex + 1], $GUI_FOCUS)
                GUISwitch($hGUI)
            EndIf
        Case $DOWN
            ConsoleWrite("Down: " & $LineIndex & " " & $NumOfInputs - 1 & @CRLF)
            ConsoleWrite("Down: " & ($LineIndex <> ($NumOfInputs)) & @CRLF)
            If $LineIndex <> ($NumOfInputs) Then ; LAST lINE
                ConsoleWrite("+ Down" & @CRLF)
                GUISwitch($hEntryGUI)
                GUICtrlSetState($input_controlls[$LineIndex + 1][$EntryIndex], $GUI_FOCUS)
                GUISwitch($hGUI)
            EndIf
        Case $bUP
            scroll("up")
        Case $bDown
            scroll("down")
    EndSwitch

WEnd

Func UpdateIndex(ByRef $A, $DIM = 4)
    $p = UBound($A)
    ReDim $A[$p + 1][$DIM]
    $NumOfInputs = $p + 1
    ConsoleWrite("+ UPDATE Index: " & $NumOfInputs & @CRLF)
    Return $p - 1
EndFunc   ;==>UpdateIndex

Func AddEntry($Switch = True, $Focus = True)
    If $Switch Then GUISwitch($hEntryGUI)

    $uI = UpdateIndex($input_controlls)
    $OPEN_INDEX = $uI
    $input_controlls[$uI][0] = GUICtrlCreateInput("LINE:" & $uI + 1, 0, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$uI][1] = GUICtrlCreateInput("", 128, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$uI][2] = GUICtrlCreateInput("", 256, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$uI][3] = GUICtrlCreateInput("", 384, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $Y += 25 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    If Check_Space($hEntryGUI) = True Then
        $Entry_Height += 25 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        Local $lP = _WinGetposIn($hEGUI, "", $hEntryGUI)
        WinMove($hEntryGUI, "", $lP[0],$lP[1], Default, $Entry_Height) ; Resize

        Local $wPos = WinGetPos($hEntryGUI)
        ConsoleWrite("! After ReSize :: Win Height: " & $wPos[3] &" WinY: " & $wPos[1]& " CtrlY: " & $Y & " Result: " & ($Y > $wPos[3]) & @CRLF)
    EndIf

    If $Focus Then GUICtrlSetState($input_controlls[$LineIndex + 1][0], $GUI_FOCUS) ; fOCUS ON NEW LINE
    If $Switch Then GUISwitch($hGUI)
EndFunc   ;==>AddEntry

Func Check_Space($hWnd)
    Local $wPos = ControlGetPos($hEGUI,"",$hWnd)
    ConsoleWrite("! Before ReSize :: Win Height: " & $wPos[3] &" WinY: " & $wPos[1]& " CtrlY: " & $Y & " Result: " & ($Y > $wPos[3]) & @CRLF)
    If ($Y > $wPos[3]) Then
        Return True
    Else
        Return False
    EndIf
EndFunc   ;==>Check_Space

Func scroll($mode)

    Local $wPos = WinGetPos($hEntryGUI)
    Local $cP = _WinGetposIn($hEGUI, "", $hEntryGUI)
    Switch $mode
        Case "up"
            ; Check if the first line is at the top and scroll if not (GUI y posn is not 0)
            If $cP[1] <> 0 Then ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            ConsoleWrite("- Scrolling:: win x: " & $cP[0] & " win y:" &  $cP[1] & " scroll:"& $cP[1] + 25 & @CRLF) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            WinMove($hEntryGUI, "", $cP[0], $cP[1] + 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            EndIf

            Local $cPos = ControlGetPos($hEntryGUI, "", $input_controlls[$OPEN_INDEX][0])
            ConsoleWrite("- Calculated Possition : Win Y: " & $wPos[2] & " $Y:" & $Y & @CRLF)
        Case "down"
            ; Check if bottom line is at the bottom and scroll if not (GUI y posn is not higher than actual GUI ht - window ht)
            If  $cp[1] > 175 - $wPos[3] Then ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                ConsoleWrite("- Scrolling:: win x: " & $cP[0] & " win y:" &  $cP[1] & " scroll:"& $cP[1] - 25 & @CRLF) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                WinMove($hEntryGUI, "", $cP[0], $cP[1] - 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            EndIf

            Local $cPos = ControlGetPos($hEntryGUI, "", $input_controlls[$OPEN_INDEX][0])
            ConsoleWrite("- Calculated Possition : Win Y: " & $wPos[2] & " $Y:" & $Y & @CRLF)
    EndSwitch
EndFunc   ;==>scroll

Func _WinGetposIn($parentW, $parentText, $childW, $childText = "")
    Local $Result, $offset

    If Not WinExists($childW) Then Return SetError(1, 1, 0)
    If Not WinExists($parentW) Then Return SetError(1, 2, 0)

    If BitAND(WinGetState($childW), 16) Or BitAND(WinGetState($parentW), 16) Then Return SetError(1, 3, 0)

    $offset = DllStructCreate("int;int")
    DllCall("User32.dll", "int", "ClientToScreen", "hwnd", WinGetHandle($parentW, $parentText), "ptr", DllStructGetPtr($offset))
    If @error Then Return SetError(1, 4, 0)
    ;ConsoleWrite(DllStructGetData($offset, 1) & ', ' & DllStructGetData($offset, 2) & @CRLF)
    $Result = WinGetPos($childW, $childText)

    $Result[0] -= DllStructGetData($offset, 1)
    $Result[1] -= DllStructGetData($offset, 2)

    Return $Result
EndFunc   ;==>_WinGetposIn

Func ClientToScreen($hWnd, $x, $Y)
    Local $stPoint = DllStructCreate("int;int"), $Result[2]

    DllStructSetData($stPoint, 1, $x)
    DllStructSetData($stPoint, 2, $Y)

    DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

    $x = DllStructGetData($stPoint, 1)
    $Result[0] = $x
    $Y = DllStructGetData($stPoint, 2)
    $Result[1] = $Y
    ; release Struct not really needed as it is a local
    $stPoint = 0
    Return $Result
EndFunc   ;==>ClientToScreen

Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg
    Local $hWndFrom, $iIDFrom, $iCode, $hWndEdit
    ;If Not IsHWnd($hEdit) Then $hWndEdit = GUICtrlGetHandle($hEdit)
    $hWndFrom = $ilParam
    $iIDFrom = _WinAPI_LoWord($iwParam)
    $iCode = _WinAPI_HiWord($iwParam)
    Switch $hWnd
        Case $hEntryGUI
            Switch $iCode
                Case $EN_SETFOCUS
                    For $i = 0 To $NumOfInputs - 1
                        $handle1 = GUICtrlGetHandle($input_controlls[$i][0])
                        $handle2 = GUICtrlGetHandle($input_controlls[$i][1])
                        $handle3 = GUICtrlGetHandle($input_controlls[$i][2])
                        $handle4 = GUICtrlGetHandle($input_controlls[$i][3])
                        If $handle1 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 1" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 0
                            $checkNextEntry = False
                            ExitLoop
                        EndIf
                        If $handle2 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 2" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 1
                            $checkNextEntry = False
                            ExitLoop
                        EndIf
                        If $handle3 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 3" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 2
                            $checkNextEntry = False
                            ExitLoop
                        EndIf
                        If $handle4 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 4" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 3
                            $checkNextEntry = True
                        EndIf
                    Next
            EndSwitch

    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @LF & _
            "+======================================================" & @LF & _
            "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
            "+======================================================" & @LF)
EndFunc   ;==>_DebugPrint

Look for the <<<<<<<<<<<<<<< lines. :(

As always, please ask if anything is unclear. :idea:

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

Digisoul,

That was fun! :)

You were using several different values (21, 22, 25, 35) to vary the scroll distance and the GUI height when you added lines. Once those were standardised at 25, life became a bit easier. The scrolling now works as it should, and you cannot go past the beginning or end of the available lines. All you need to do when adding a line is call a "down" scroll - simple, eh :) :

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>
#include <WinAPI.au3>

Global $input_controlls[1][4], $iCnt = 0, $hEntryGUI, $entry_scroll = False, $NumOfInputs = 1, $LineIndex = 0, $EntryIndex = 0, $OPEN_INDEX, $checkNextEntry = False, $Y = 2, $hEGUI
Global $Entry_Height = 175
Global $user32 = DllOpen("user32.dll")
#region ### START Koda GUI section ### Form=
$hGUI = GUICreate("Form2", 625, 298, 193, 222)


$bUp = GUICtrlCreateButton(Chr("0xE1"), 555, 0, 20)
GUICtrlSetFont($bUp, Default, Default, Default, "Wingdings")
$bDown = GUICtrlCreateButton(Chr("0xE2"), 555, $Entry_Height - 23, 20)
GUICtrlSetFont($bDown, Default, Default, Default, "Wingdings")


$NEXT = GUICtrlCreateDummy()
$DOWN = GUICtrlCreateDummy()
$UP = GUICtrlCreateDummy()
$UP = GUICtrlCreateDummy()

$hEGUI = GUICreate("Entry Parrent Gui", 555, $Entry_Height, 0, 0, $WS_CHILD, -1, $hGUI)
GUISetState()
$hEntryGUI = GUICreate("Entry Gui", 555, $Entry_Height, 0, 0, $WS_CHILD, -1, $hEGUI)
GUISetBkColor(0X006400)



$yPos = _WinGetposIn($hEGUI, "", $hEntryGUI)
Global $default_pos = $yPos[1]


For $i = 0 To 6
    $input_controlls[$i][0] = GUICtrlCreateInput("LINE" & $i + 1, 0, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$i][1] = GUICtrlCreateInput("", 128, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$i][2] = GUICtrlCreateInput("", 256, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$i][3] = GUICtrlCreateInput("", 384, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    UpdateIndex($input_controlls)
    $Y += 25
Next

ConsoleWrite("Default Y Position: "&$default_pos&@CRLF)

GUISetState()
GUISwitch($hGUI)
GUISetState()

Dim $keys[3][2] = [["{ENTER}", $NEXT],["{DOWN}", $DOWN],["{UP}", $UP]]
GUISetAccelerators($keys, $hGUI)

#endregion ### END Koda GUI section ###
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
;GUIRegisterMsg($WM_SIZE, "WM_SIZE")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $NEXT
            If $checkNextEntry = True Then
                ;ConsoleWrite("Entry On: " & ($LineIndex + 1) & "==" & ($NumOfInputs - 1) & @CRLF)
                ;ConsoleWrite("Y:: " & $Y & "NEW y: " & ($Y + 30) & @CRLF)
                If ($LineIndex + 1) == ($NumOfInputs - 1) Then ; Last Line
                    ; New Line Entry
                    AddEntry(True, True)
                    scroll("down")
                Else
                    ; Focus On The Next Line
                    GUISwitch($hEntryGUI)
                    GUICtrlSetState($input_controlls[$LineIndex + 1][0], $GUI_FOCUS)
                    ;_SetFocus(GUICtrlGetHandle($input_controlls[$LineIndex + 1][0]))

                    GUISwitch($hGUI)
                EndIf
            Else
                ;Focus on The Next Cell
                GUISwitch($hEntryGUI)
                ;_SetFocus(GUICtrlGetHandle($input_controlls[$LineIndex][$EntryIndex + 1]))
                GUICtrlSetState($input_controlls[$LineIndex][$EntryIndex + 1], $GUI_FOCUS)
                GUISwitch($hGUI)
            EndIf
        Case $DOWN
            ConsoleWrite("Down: " & $LineIndex & " " & $NumOfInputs - 1 & @CRLF)
            ConsoleWrite("Down: " & ($LineIndex <> ($NumOfInputs)) & @CRLF)
            If $LineIndex <> ($NumOfInputs) Then ; LAST lINE
                ConsoleWrite("+ Down" & @CRLF)
                GUISwitch($hEntryGUI)
                GUICtrlSetState($input_controlls[$LineIndex + 1][$EntryIndex], $GUI_FOCUS)
                GUISwitch($hGUI)
            EndIf
        Case $bUP
            scroll("up")
        Case $bDown
            scroll("down")
    EndSwitch

WEnd

Func UpdateIndex(ByRef $A, $DIM = 4)
    $p = UBound($A)
    ReDim $A[$p + 1][$DIM]
    $NumOfInputs = $p + 1
    ConsoleWrite("+ UPDATE Index: " & $NumOfInputs & @CRLF)
    Return $p - 1
EndFunc   ;==>UpdateIndex

Func AddEntry($Switch = True, $Focus = True)
    If $Switch Then GUISwitch($hEntryGUI)

    $uI = UpdateIndex($input_controlls)
    $OPEN_INDEX = $uI
    $input_controlls[$uI][0] = GUICtrlCreateInput("LINE:" & $uI + 1, 0, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$uI][1] = GUICtrlCreateInput("", 128, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$uI][2] = GUICtrlCreateInput("", 256, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $input_controlls[$uI][3] = GUICtrlCreateInput("", 384, $Y, 121, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH)
    $Y += 25 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    If Check_Space($hEntryGUI) = True Then
        $Entry_Height += 25 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        Local $lP = _WinGetposIn($hEGUI, "", $hEntryGUI)
        WinMove($hEntryGUI, "", $lP[0],$lP[1], Default, $Entry_Height) ; Resize

        Local $wPos = WinGetPos($hEntryGUI)
        ConsoleWrite("! After ReSize :: Win Height: " & $wPos[3] &" WinY: " & $wPos[1]& " CtrlY: " & $Y & " Result: " & ($Y > $wPos[3]) & @CRLF)
    EndIf

    If $Focus Then GUICtrlSetState($input_controlls[$LineIndex + 1][0], $GUI_FOCUS) ; fOCUS ON NEW LINE
    If $Switch Then GUISwitch($hGUI)
EndFunc   ;==>AddEntry

Func Check_Space($hWnd)
    Local $wPos = ControlGetPos($hEGUI,"",$hWnd)
    ConsoleWrite("! Before ReSize :: Win Height: " & $wPos[3] &" WinY: " & $wPos[1]& " CtrlY: " & $Y & " Result: " & ($Y > $wPos[3]) & @CRLF)
    If ($Y > $wPos[3]) Then
        Return True
    Else
        Return False
    EndIf
EndFunc   ;==>Check_Space

Func scroll($mode)

    Local $wPos = WinGetPos($hEntryGUI)
    Local $cP = _WinGetposIn($hEGUI, "", $hEntryGUI)
    Switch $mode
        Case "up"
            ; Check if the first line is at the top and scroll if not (GUI y posn is not 0)
            If $cP[1] <> 0 Then ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            ConsoleWrite("- Scrolling:: win x: " & $cP[0] & " win y:" &  $cP[1] & " scroll:"& $cP[1] + 25 & @CRLF) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            WinMove($hEntryGUI, "", $cP[0], $cP[1] + 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            EndIf

            Local $cPos = ControlGetPos($hEntryGUI, "", $input_controlls[$OPEN_INDEX][0])
            ConsoleWrite("- Calculated Possition : Win Y: " & $wPos[2] & " $Y:" & $Y & @CRLF)
        Case "down"
            ; Check if bottom line is at the bottom and scroll if not (GUI y posn is not higher than actual GUI ht - window ht)
            If  $cp[1] > 175 - $wPos[3] Then ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                ConsoleWrite("- Scrolling:: win x: " & $cP[0] & " win y:" &  $cP[1] & " scroll:"& $cP[1] - 25 & @CRLF) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                WinMove($hEntryGUI, "", $cP[0], $cP[1] - 25) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            EndIf

            Local $cPos = ControlGetPos($hEntryGUI, "", $input_controlls[$OPEN_INDEX][0])
            ConsoleWrite("- Calculated Possition : Win Y: " & $wPos[2] & " $Y:" & $Y & @CRLF)
    EndSwitch
EndFunc   ;==>scroll

Func _WinGetposIn($parentW, $parentText, $childW, $childText = "")
    Local $Result, $offset

    If Not WinExists($childW) Then Return SetError(1, 1, 0)
    If Not WinExists($parentW) Then Return SetError(1, 2, 0)

    If BitAND(WinGetState($childW), 16) Or BitAND(WinGetState($parentW), 16) Then Return SetError(1, 3, 0)

    $offset = DllStructCreate("int;int")
    DllCall("User32.dll", "int", "ClientToScreen", "hwnd", WinGetHandle($parentW, $parentText), "ptr", DllStructGetPtr($offset))
    If @error Then Return SetError(1, 4, 0)
    ;ConsoleWrite(DllStructGetData($offset, 1) & ', ' & DllStructGetData($offset, 2) & @CRLF)
    $Result = WinGetPos($childW, $childText)

    $Result[0] -= DllStructGetData($offset, 1)
    $Result[1] -= DllStructGetData($offset, 2)

    Return $Result
EndFunc   ;==>_WinGetposIn

Func ClientToScreen($hWnd, $x, $Y)
    Local $stPoint = DllStructCreate("int;int"), $Result[2]

    DllStructSetData($stPoint, 1, $x)
    DllStructSetData($stPoint, 2, $Y)

    DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

    $x = DllStructGetData($stPoint, 1)
    $Result[0] = $x
    $Y = DllStructGetData($stPoint, 2)
    $Result[1] = $Y
    ; release Struct not really needed as it is a local
    $stPoint = 0
    Return $Result
EndFunc   ;==>ClientToScreen

Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    #forceref $hWnd, $iMsg
    Local $hWndFrom, $iIDFrom, $iCode, $hWndEdit
    ;If Not IsHWnd($hEdit) Then $hWndEdit = GUICtrlGetHandle($hEdit)
    $hWndFrom = $ilParam
    $iIDFrom = _WinAPI_LoWord($iwParam)
    $iCode = _WinAPI_HiWord($iwParam)
    Switch $hWnd
        Case $hEntryGUI
            Switch $iCode
                Case $EN_SETFOCUS
                    For $i = 0 To $NumOfInputs - 1
                        $handle1 = GUICtrlGetHandle($input_controlls[$i][0])
                        $handle2 = GUICtrlGetHandle($input_controlls[$i][1])
                        $handle3 = GUICtrlGetHandle($input_controlls[$i][2])
                        $handle4 = GUICtrlGetHandle($input_controlls[$i][3])
                        If $handle1 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 1" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 0
                            $checkNextEntry = False
                            ExitLoop
                        EndIf
                        If $handle2 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 2" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 1
                            $checkNextEntry = False
                            ExitLoop
                        EndIf
                        If $handle3 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 3" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 2
                            $checkNextEntry = False
                            ExitLoop
                        EndIf
                        If $handle4 = $hWndFrom Then
                            ConsoleWrite("> In Focus Line #  " & $i & " entry number: 4" & @CRLF & @CRLF)
                            $LineIndex = $i
                            $EntryIndex = 3
                            $checkNextEntry = True
                        EndIf
                    Next
            EndSwitch

    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @LF & _
            "+======================================================" & @LF & _
            "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
            "+======================================================" & @LF)
EndFunc   ;==>_DebugPrint

Look for the <<<<<<<<<<<<<<< lines. :(

As always, please ask if anything is unclear. :idea:

M23

You are GENIUS, Thank you very much, i was totally stuck! you really save my day :)

I already watch your example on scroll bars

http://www.autoitscript.com/forum/index.php?showtopic=112865&st=0&p=790676&hl=scroll&fromsearch=1&#entry790676

but i was unable to understand the concept for Max & Page Size settings also how to rearrange the scrolls dynamically , thats why i come to the button controls, anyways Thank You very much for your kind help.

Just 1 last question, if i am on Line#1 and want to jump on last line ? Posted Image

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

  • Moderators

Digisoul,

Add these lines in the appropriate places (I have done a jump to both beginning and end - I knew you would only ask again :) ):

$bBegin = GUICtrlCreateButton("B", 555, 24, 20)
$bEnd = GUICtrlCreateButton("E", 555, $Entry_Height - 47, 20)

; ----------

Case $bBegin
    begin()
Case $bEnd
    end()

; ----------

Func begin()
    Local $cP
    Do
        $cP = _WinGetposIn($hEGUI, "", $hEntryGUI)
        scroll("up")
    Until $cP[1] = 0
EndFunc

Func end()
    Local $wPos = WinGetPos($hEntryGUI)
    For $i = 1 To ($wPos[3] - 175) / 25
        Scroll("down")
    Next
EndFunc

Keep your eye on the Examples section over the next few days, I think I have cracked the Page/Max formulae for scrollbars! :idea:

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

Again Thank you very much!

for jump on 1st line i try this & its worked Posted Image

If $cP[1] <> 0 Then  
        WinMove($hEntryGUI, "", $cP[0], 0) ; To Jump on the 1st entry 
            EndIf

Keep your eye on the Examples section over the next few days, I think I have cracked the Page/Max formulae for scrollbars! :idea:

I will wait for your example!Posted Image

73 108 111 118 101 65 117 116 111 105 116

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