Results 1 to 31 of 31

Thread: [RESOLVED] total lines in a textbox

Hybrid View

  1. #1
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: [RESOLVED] total lines in a textbox

    You can do call Win32 API functions in VB .Net, can you not? I know you can do it in C#.

    Imports System.Runtime.InteropServices

    Looks like you can o_O

    Also looks like all hope is not lost!

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2003
    Location
    ohio, usa
    Posts
    719

    Re: [RESOLVED] total lines in a textbox

    I would think the code I used for VB 6 could be converted to VB 2008 XE.


    I could write a small program using the function and then run it thru the VB 2008 VB XE converter.

  3. #3
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: [RESOLVED] total lines in a textbox

    vb.net Code:
    1. Imports System.Runtime.InteropServices
    2.  
    3. Public Class Form1
    4.     Private Const EM_GETLINECOUNT As Integer = &HBA
    5.     Declare Auto Function SendMessage Lib "user32" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
    6.  
    7.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    8.         Dim lineCount As Integer = SendMessage(TextBox1.Handle, EM_GETLINECOUNT, 0, 0)
    9.     End Sub
    10. End Class

    We win!

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2003
    Location
    ohio, usa
    Posts
    719

    Re: [RESOLVED] total lines in a textbox

    thanks!!! it works just like in VB 6.


    thanks again!!!

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