scila1996 Posted September 1, 2014 Share Posted September 1, 2014 I have a text file Example I Am a NGTRUNG Hai Noi University of Science Technology aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww dddddddddddddddddddddddddddddddddddddddddd any any any . Wait ....................... 24 Step one: I want the program to read this file Step two: Read the last line, I'll put that last line of content font size 8, 10, 12, 14, 16, 18, 24 Step three: Create a window and set an "Lable" to accommodate the full contents of a file on example, Thank you Link to comment Share on other sites More sharing options...
Developers Jos Posted September 1, 2014 Developers Share Posted September 1, 2014 I have a text file Thank you What is the question? Jos scila1996 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Muzaiyan Posted September 1, 2014 Share Posted September 1, 2014 is this piece of code seems useful #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <File.au3> Global $GUI, $msg, $GUI_WIDTH = 700, $GUI_HEIGHT = 500, $Edit_Control Global $file = "New Text Document.txt" Global $data = "", $font_size Global $GUI = GUICreate("", $GUI_WIDTH, $GUI_HEIGHT, -1, -1, $WS_SYSMENU) $font_size = FileReadLine($file, _FileCountLines($file)) GUICtrlCreateEdit($data, 0, 0, $GUI_WIDTH, $GUI_HEIGHT) GUICtrlSetFont(-1, $font_size) For $i = 1 To $font_size GUICtrlSetData(-1, FileReadLine($file, $i) & @CRLF, 1) Next GUISetState() While True $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd scila1996 1 Link to comment Share on other sites More sharing options...
scila1996 Posted September 2, 2014 Author Share Posted September 2, 2014 my intention is to create a GUI window with sufficient size to contain all the data in a text file - Read text files on - Read the last line ---> specify the size of the display Create a window to contain the entire contents of the file with the specified font size in the last line Link to comment Share on other sites More sharing options...
Muzaiyan Posted September 2, 2014 Share Posted September 2, 2014 replace "New Text Document.txt" with your file name in the above script Link to comment Share on other sites More sharing options...
MikahS Posted September 2, 2014 Share Posted September 2, 2014 I'm not sure if this pertains to the entire GUI window created with GUICreate() but I'm thinking Melba's UDF for stringsize could be very helpful: >link Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Muzaiyan Posted September 3, 2014 Share Posted September 3, 2014 good always search on the forum before posting a question if you want to use default width, height and style just use GuiCreate("") Link to comment Share on other sites More sharing options...
MikahS Posted September 3, 2014 Share Posted September 3, 2014 The whole point of this post was for a way to make a dynamic height and width for OP, Muzaiyan. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now