-
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.
-
Senior Member
.....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
-
Last edited by alice 03; 11-09-2009 at 05:29 PM.
-
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
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|