I do have a little problem to keep ALL the entered text visible in a textbox, setup for multiline input.
After initializing the userform, i have a textbox with a height of 20 and a font = Tahoma / Bold / size 10.
The width of the textbox = 186
After entering the first text line (3 characters for testing), i press the Ctrl + Enter key, so that i go to the next line (crlf).
Now i notice that the first line of text is moving a bit up, but still visible.
if I enter now the second line of text, the first entered text is completely moved up and no longer visible, even due to the fact that I enlarge the textbox heigth in the KeyDown event.
The more text lines i add the more likely that the second line also disapears from the textbox.
I tried to set the textbox Autosize to True, but it act the same. First line of text is moving up and no longer visible.
Is it uberhaupt possible to keep ALL the entered text in the textbox visible, and not moving up?
if so, how can it be done?
following code are the used events for this textbox:
Private Sub tbLabelText_Enter() With Me .tbLabelText.BackColor = cYellow End With End Sub Private Sub tbLabelText_Exit(ByVal Cancel As MSForms.ReturnBoolean) With Me .tbLabelText.BackColor = cWhite sText = .tbLabelText.Text .cmdFillLabels.Enabled = True End With End Sub Private Sub tbLabelText_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) 'if multiline text, we enlarge the textbox height If KeyCode = 13 Then With Me .tbLabelText.Height = .tbLabelText.Height + Int(.tbLabelText.Font.Size) + 1 End With End If End Sub
Best regards and thanks for any help.