Click to See Complete Forum and Search --> : VB wordpad for PHP
strawberrygrrl
May 17th, 2002, 12:51 PM
my task: to design a wordprocessing program for php code in VB. the only part i'm having trouble with is having a function that counts the lines in the text box. any ideas how i could do this?
blindlizard
May 20th, 2002, 04:12 PM
Count the number of vbCrLf in the text box. Or better yet, split on vbCrLf and get the UBound of the array returned.
The Hobo
May 21st, 2002, 10:42 PM
Originally posted by blindlizard
Count the number of vbCrLf in the text box. Or better yet, split on vbCrLf and get the UBound of the array returned.
1) This isn't a PHP question
2) If there's a wordwrap feature, then counting vbCrLf's wont work
nabeels786
May 27th, 2002, 05:39 PM
i think it would work with a wordwrap, because if one line goes onto the next, i dont theres a hard newline at the end
it doesnt matter if this isnt a php question, just answer it and tell them to post in the right forum next time :rolleyes:
The Hobo
May 27th, 2002, 09:40 PM
Originally posted by nabeels786
i think it would work with a wordwrap, because if one line goes onto the next, i dont theres a hard newline at the end
it doesnt matter if this isnt a php question, just answer it and tell them to post in the right forum next time :rolleyes:
1) No, it will not work with wordwrap. It will give you the number of actual lines, but not the number of visual lines.
2) If it doesn't matter that it's not a PHP question, then why tell them to post in the right forum? :rolleyes:
The Hobo
May 27th, 2002, 09:43 PM
Using API:
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As _
Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_GETLINECOUNT = &HBA
Private Sub Command1_Click()
MsgBox SendMessage(Text1.hwnd, EM_GETLINECOUNT, 0&, 0&)
End Sub
Will retrieve the number of lines in the textbox, not dependant on vbCrLf's.
nabeels786
May 28th, 2002, 03:09 PM
[i]the number of actual lines, but not the number of visual lines.
2) If it doesn't matter that it's not a PHP question, then why tell them to post in the right forum? :rolleyes:
so then next time they will post them in the right forum instead of here..
The Hobo
May 28th, 2002, 05:30 PM
But you said it didn't matter, nablees :) I love you's like a brotha, man. Pe-yece!
strawberrygrrl
May 28th, 2002, 07:56 PM
when i posted this on the vb forum, ppl said "this isn't a vb problem, post elsewhere." so i just posted it in both.
thanx for all suggestions :D
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.