I found this code to help make a richtextbox control fairly flickerfree.
How can I convert this sublassed control to a dll that I can add to my toolbox ?
How can I convert this sublassed control to a dll that I can add to my toolbox ?
VB.NET:
Imports System
Imports System.Windows.Forms
Public Class FlickerFreeRichTextbox
Inherits RichTextBox
Private Const WM_PAINT As integer = 0
Public Shared _Paint As Boolean = True
Public Sub New()
MyBase.New()
End Sub
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If (m.Msg = WM_PAINT) Then
If _Paint Then
MyBase.WndProc(m)
Else
m.Result = IntPtr.Zero
End If
Else
MyBase.WndProc(m)
End If
End Sub
End Class
VB.NET:
Private Sub richTextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If populating Then
Return
End If
ColorSyntaxEditor.FlickerFreeRichEditTextBox._Paint = false
'do your processing here
ColorSyntaxEditor.FlickerFreeRichEditTextBox._Paint = true
End Sub