Jump to content

How to create a window similar to paragraph text


 Share

Recommended Posts

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,
 
 
post-84392-0-74016900-1409599894_thumb.p
 
Thank you :)
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

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 ~ getENVvars
My 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

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 ~ getENVvars
My 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

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