Sign in to follow this  
Followers 0

window not scrollable

3 posts in this topic

#1 ·  Posted (edited)

Hi there,

i try to create a checkbox window which seems to work but i am not able to scroll

further down.Does anyone have an idea?

Also if i click"save"in my script i would like to close the GUI amd save to the specified

text file but so far no success either.

Any hint much appreciated.

#include <GUIConstants.au3>
#include <File.au3>
#Include <Array.au3>

Global $aArray
_FileReadToArray('C:\NTRESKIT\users.txt', $aArray)
If @error Then
    MsgBox(0x1, 'Error', "_FileReadToArray('users.txt', $aArray)")

GUICreate('Users to Move',400,500,-1,-1,$WS_VSCROLL)
Global $checkbox[$aArray[0] + 1]
For $i = 1 To $aArray[0]
    $checkbox[$i] = GUICtrlCreateCheckbox($aArray[$i], 20, 18 * $i)
$button_process = GUICtrlCreateButton('&Save', 250, 350, 80)
$button_exit = GUICtrlCreateButton('E&xit', 250, 400, 50)
GUISetState(@SW_SHOW )
While 1
    $msg = GUIGetMsg()
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $button_exit
        Case $msg = $button_process
            For $i = 1 To $aArray[0]
                ; Check state of checkboxes and do conditional action
                If GUICtrlRead($checkbox[$i]) = $GUI_CHECKED Then
                    $file = FileOpen("C:\NTRESKIT\members3.txt",1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")

FileWrite($file,$aArray[$i] &@CRLF  )




Edited by Larry

Share this post

Link to post
Share on other sites

$WS_VSCROLL is not meant to be used with GUI windows but with controls like EditBox and ListView.

Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post

Link to post
Share on other sites

A window is one big control and someone quite some time back made a scrollable Gui. I remember it did not take much code to enable it but not sure where to find the script. A bit of searching may reap results.

Share this post

Link to post
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
Sign in to follow this  
Followers 0