9720.html
来自「以电子书的形式收集了VB一些常见问题解决方法,可以很方便的查找自己需要解决的问题」· HTML 代码 · 共 27 行
HTML
27 行
<html>
<head>
<title>有两个方法</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>有两个方法</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:winntuser@hotmail.com">Windows NT user</a> on February 01, 1999 at 08:36:43:<p>
In Reply to: <a href="9683.html">请问如何取得RichTextBox所显示的文字行数?</a> posted by Chennet on January 29, 1999 at 23:49:44:<p>
: 在RichTextBox,不像ListBox内有listcount的属性<br>: 请问如何取得RichTextBox所显示的文字行数?<p>第一:<br>把RichTextBox里的文字提取出来,然后用回圈数(提示:行与行之间是以vbCrLf分隔的)<br>第二:<br>Option Explicit<br>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<br>Private Const EM_GETLINECOUNT = &HBA<p>Private Sub Command1_Click()<br>Dim lineCount As Long<br>lineCount = SendMessage(RichTextBox1.hwnd, EM_GETLINECOUNT, 0, ByVal 0&) <br>Debug.Print lineCount<br>End Sub<br>这个方法应比较快<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 9720-->
<!--top: 9730--><li><a href="9730.html">Thanks WindowsNT user</a> <b>Chennet</b> <i>11:49:23 2/01/99</i>
(<!--responses: 9730-->0)
<ul><!--insert: 9730-->
</ul><!--end: 9730-->
</ul><!--end: 9720-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?