TextBox/RichTextBoxの行数を取得
VisualBasic6用
TextBox/RichTextBoxの行数を取得
Const EM_GETLINECOUNT = &HBA Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long ' TextBox/RichTextBoxの行数を取得 ' ' lngHWnd : TextBox/RichTextBox のウィンドウハンドル ' ' 戻り値 : 正常 - 行数 ' 異常 - -1 ' Function GetLineCount(ByVal lngHwnd As Long) As Long GetLineCount = SendMessage(lngHwnd, EM_GETLINECOUNT, 0, 0) End Function