|
-
Nov 5th, 1999, 11:49 AM
#1
Thread Starter
Fanatic Member
How can I do it so when there is too many characters in one line it will automatically send cursor to another line? In RichTextBox
------------------
Visual Basic Programmer (at least I want to be one)
-----------------
PolComSoft
You will hear a lot about it.
[This message has been edited by QWERTY (edited 11-05-1999).]
-
Nov 5th, 1999, 07:22 PM
#2
Guru
Try using the EM_LINELENGTH message, like this:
Code:
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
Private Const EM_LINELENGTH = &HC1
Private Const MaxLineLength = 20 ' Change to... Whatever...
Private Sub RichTextBox1_Change()
If SendMessage(RichTextBox1.hWnd, EM_LINELENGTH, RichTextBox1.SelStart, ByVal 0&) >= MaxLineLength Then RichTextBox1.SelText = vbNewLine
End Sub
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
-
Nov 5th, 1999, 08:04 PM
#3
New Member
Set the RichTextBox's RightMargin property to the max line length that you want this will start the text wrap once the line is the max length. If you wish to stop the text wrap altogether set it to around 99999.
[This message has been edited by Dingo (edited 11-06-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|