Results 1 to 9 of 9

Thread: VB wordpad for PHP

  1. #1

    Thread Starter
    Junior Member strawberrygrrl's Avatar
    Join Date
    Apr 2002
    Location
    In my secret lair
    Posts
    25

    VB wordpad for PHP

    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?

  2. #2
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141
    Count the number of vbCrLf in the text box. Or better yet, split on vbCrLf and get the UBound of the array returned.
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    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
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    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
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  5. #5
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    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
    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?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Using API:

    VB Code:
    1. Private Declare Function SendMessage Lib "user32" _
    2. Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As _
    3. Long, ByVal wParam As Long, lParam As Any) As Long
    4.  
    5. Private Const EM_GETLINECOUNT = &HBA
    6.  
    7. Private Sub Command1_Click()
    8.   MsgBox SendMessage(Text1.hwnd, EM_GETLINECOUNT, 0&, 0&)
    9. End Sub

    Will retrieve the number of lines in the textbox, not dependant on vbCrLf's.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    [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?
    so then next time they will post them in the right forum instead of here..
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  8. #8
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    But you said it didn't matter, nablees I love you's like a brotha, man. Pe-yece!
    My evil laugh has a squeak in it.

    kristopherwilson.com

  9. #9

    Thread Starter
    Junior Member strawberrygrrl's Avatar
    Join Date
    Apr 2002
    Location
    In my secret lair
    Posts
    25
    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

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