A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: text in edit box help?

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    3

    text in edit box help?

    im using 3dflash 4987
    im using text in an edit box but im trying to find a way to fully justify the text.
    (spread the text out to meet right/left borders evenly on each line of type)
    is there a way to do this or a script i can use?
    tia.
    alice 03.

  2. #2
    Senior Member zoranvedek's Avatar
    Join Date
    Aug 2001
    Location
    Wagoner OK
    Posts
    893
    .....as far as I know the edit box will read basic html(b, br, center, font, mostly text related) other than that, I don't think it will do what you're needing.


    -J

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    3
    : (
    Last edited by alice 03; 11-09-2009 at 05:29 PM.

  4. #4
    Junior Member
    Join Date
    Dec 2009
    Posts
    1
    Here is a routine to do it. It is a modified version of what can be found
    at http://www.freevbcode.com/ShowCode.asp?ID=2493

    Public Function GetTextBoxLine(hWnd As Long) As String
    'INPUT: hWnd = Handle to text box
    'OUTPUT: Text of specified TextBox Control

    Dim lngLineCount As Long
    Dim lngLineNumber As Long
    Dim lngRet As Long
    Dim lngLen As Long
    Dim lngFirstCharPos As Long
    Dim bytBuffer() As Byte
    Dim strAns As String

    'get number of lines
    lngLineCount = SendMessage(hWnd, EM_GETLINECOUNT, 0, 0&)

    For lngLineNumber = 0 To lngLineCount - 1
    'first character position of the line
    lngFirstCharPos = SendMessage(hWnd, EM_LINEINDEX, lngLineNumber, 0&)

    'length of line
    lngLen = SendMessage(hWnd, EM_LINELENGTH, lngFirstCharPos, 0&)

    ReDim bytBuffer(lngLen) As Byte

    bytBuffer(0) = lngLen

    'text of line saved to bytBuffer
    lngRet = SendMessage(hWnd, EM_GETLINE, lngLineNumber, bytBuffer(0))

    If lngRet Then
    strAns = strAns & Left$(StrConv(bytBuffer, vbUnicode), lngLen)
    End If
    Next

    GetTextBoxLine = strAns
    End Function

    You can call it by GetTextBoxLine([hWnd of Control])



    edited by admin: commercial links are not permitted on the forum, thank you

  5. #5
    Junior Member
    Join Date
    Nov 2009
    Posts
    3
    ooh thanx
    will try it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center