Jump to content

Recommended Posts

Posted

Hey there everyone.

Is there a way to retrieve text in a file and display it in a window on a custom GUI so the user can cut and paste the text into a document of their choice? I envision a text box with a scroll bar if too large to fit in the area provided.

Thanks for your guidance on this.

Sue

  • 3 months later...
Posted

Hey there everyone.

Is there a way to retrieve text in a file and display it in a window on a custom GUI so the user can cut and paste the text into a document of their choice? I envision a text box with a scroll bar if too large to fit in the area provided.

Thanks for your guidance on this.

Sue

Hi Sue,

I am new to Autoit and have been looking for help to do exactly what you have mentioned. Is it possible for you to post the code you used to display text in a scrolling text box?

Thanks

Alan :)

Posted (edited)

Hi Sue,

I am new to Autoit and have been looking for help to do exactly what you have mentioned. Is it possible for you to post the code you used to display text in a scrolling text box?

Thanks

Alan :)

This will do the trick

#include <GUIConstants.au3>

$textfile = FileOpen("C:\boot.ini",0) ;Any text file will work
$text = FileRead($textfile)
FileClose($textfile)

GUICreate("Displaying a text file" , 400,400)

GUICtrlCreateEdit($text,5,5,390,390)
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
    EndIf
WEnd
Edited by arcticflame

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...