-
Jul 20th, 2013, 06:58 PM
#1
Thread Starter
Banned
[RESOLVED] text1.text help
multi line textbox
i wish to add <br> front of all text
Private Sub Text21_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then ' The ENTER key.
Text21.Text = "<br>"
End If
End Sub
demo
once upon a time (i hit enter hey here ) <br> there was a tiger i love it alot (i hit enter hey here ) <br> that night was so good
output results
once upon a time <br> there was a tiger i love it alot <br> that night was so good
how do i do that i wish to add <br> front of current strings when enter key is hit
-
Jul 20th, 2013, 07:04 PM
#2
Thread Starter
Banned
Re: text1.text help
If KeyAscii = 13 Then ' The ENTER key.
Text21.Text = Text21.Text & "<br>"
End If
when i do this the textbox leaves emty room on top and starts all them in new line dam
-
Jul 20th, 2013, 07:05 PM
#3
Re: text1.text help
Text21 = Text21.Text & <br>
???
-
Jul 20th, 2013, 07:09 PM
#4
Re: text1.text help
Code:
Private Sub Text21_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
KeyAscii = 0
Text21.Text = Text21.Text & " <br> "
Text21.SelStart = Len(Text21.Text)
End If
End Sub
-
Jul 20th, 2013, 07:12 PM
#5
Thread Starter
Banned
Re: text1.text help
Originally Posted by Max187Boucher
Text21 = Text21.Text & <br>
???
i need to do something like this without the keypress event , but keypress event will help me allot when am typing large text instead of click the button
when i use keypress textbox leaves emty line on top this is another press
Text21 = Text21.Text & <br> works but thinking what other way i can add this when enter key is pressed so that the textbox dont leave emty line on top
-
Jul 20th, 2013, 07:13 PM
#6
Lively Member
Re: text1.text help
First of all you can't use KeyPress while the focus is on TextBox! use a key combination like ALT + ENTER
Second: TEXT21.TEXT = "<br>" & TEXT21.TEXT & "<br>"
-
Jul 20th, 2013, 07:13 PM
#7
Thread Starter
Banned
Re: text1.text help
Originally Posted by Max187Boucher
Code:
Private Sub Text21_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
KeyAscii = 0
Text21.Text = Text21.Text & " <br> "
Text21.SelStart = Len(Text21.Text)
End If
End Sub
great thanks allot
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
|