Jump to content

Recommended Posts

Posted

Hi..

I am trying to make a window which displays some text, the text is read from an external file so I dont have to change the program if I want to change the text. It looks like a license agreement style box but just contains instructions.

I used a label and made it white but I cant get it to scroll.

Should I be using something different.. I basically just want it to show a scrollable text box..

So far it looks like this Posted Image

#include <GuiConstants.au3>



GuiCreate("Setup", 392, 323,(@DesktopWidth-392)/2, (@DesktopHeight-323)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS )

$Label_1 = GuiCtrlCreateLabel("" & @CRlf & "", 10, 10, 370, 270, $SS_SUNKEN )
GuiCtrlSetBkColor(-1, 0xFFFFFF)

$file = FileOpen("test.txt", 0)
$Write=""
; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

; Read in lines of text until the EOF is reached
While 1
    $line = FileReadLine($file)
    $Write = $Write & @CRLF & $Line
    If @error = -1 Then ExitLoop
        
   ;MsgBox (0,"",$Line)
Wend

FileClose($file)

GUICtrlSetData ( $Label_1, $Write )






GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

Please point me in the right direction.

Thanks

Chris

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
×
×
  • Create New...