|
|
|
You can quickly determine how many lines of text are contained in a multiline TextBox control whose Scrollbars property is set to 3-Both - that is, when the TextBox behaves like a programmer's editor - by counting the number of CR-LF characters in the Text property. You can do that in just one line of code as follows: |
However, this approach fails when Scrollbars = 2-Vertical, that is when the TextBox behave like a word processor and wraps longer lines. A better approach - that works with any type of multiline TextBox control - is to send it the EM_GETLINECOUNT message: |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|