'An unhandled exception of type 'System.NullReferenceException' occurred
in system.windows.forms.dll
'Additional information: Object reference not set to an instance of an
object.
in module:
Dim nrtb As New RichTextBox
Sub DisplayMessage(ByVal rtb As RichTextBox, ByVal sText As String,
Optional ByVal Colour As String = "")
rtb.SelectionStart = rtb.Text.Length
' rtb.doColor(rtb, DirectCast(sText, String))
' rtb.doColor(rtb, CType(sText, String))
rtb.SelectedText = nrtb.doColor(rtb, sText) <=======error
occurred here
rtb.SelectionStart = rtb.Text.Length
rtb.ScrollToCaret()
sText = String.Empty
End Sub
i don't know if i should do sub new() in module or in usercontrol or both
regards,