Richtextbox resized smaller, vertical scrollbar disappears. Any idea how to fix this?
I know the current version of Visual Studio has this bug fixed, but does anyone know of a way to correct this with VB 2010, 4.0 NET?
I tried to programmatically double click the richtextbox when I resize the form to get the vertical scrollbar to reappear, but that doesn't work.
Code:
If Me.Height <= t Then
RichTextBox2_DoubleClick(sender, e)
t = Me.Height
Else
End If
Any ideas besides upgrading?
Re: Richtextbox resized smaller, vertical scrollbar disappears. Any idea how to fix t
Still using VB10 on Win7 here, When I have RTB resize with form (anchored on all sides) invalidating the RTB in forms resize-end event works here,...
Code:
Private Sub FrmMain_ResizeEnd(sender As Object, e As EventArgs) Handles Me.ResizeEnd
RTB1.Invalidate()
End Sub
Other workarounds, might be to toogle the rtb ScrollBars property,
http://www.vbforums.com/showthread.php?793671
Re: Richtextbox resized smaller, vertical scrollbar disappears. Any idea how to fix t
Quote:
Originally Posted by
Edgemeal
Still using VB10 on Win7 here, When I have RTB resize with form (anchored on all sides) invalidating the RTB in forms resize-end event works here,...
Thanks Edgemeal! This did it for me:
RichTextBox2.Invalidate(True)
Also, to prevent that funky scroll to caret in the richtextbox while resizing the form, I give a hidden label focus in the form's 'Resize' event, and refocus the richtextbox on it's 'MouseEnter' event.
Code:
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
Label1.Focus()
RichTextBox2.Invalidate(True)
End Sub
Private Sub RichTextBox2_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles RichTextBox2.MouseEnter
RichTextBox2.Focus()
End Sub