M
M
Mr. Abdu Jan2014-09-26 10:28:03
Visual Basic
Mr. Abdu Jan, 2014-09-26 10:28:03

How to call RichTextBox from another class?

Hello everyone,
I have a procedure that needs to add data to a RichTextBox.

Public Sub insertLogHistory(messageStr As String)
     Me.LogHistory.Text = Me.LogHistory.Text + vbCrLf + Date.Now + " - " + messageStr
End Sub

Calling a procedure from another class
Dim FormClass As New Form1()
Public Function HelloWorld() As Boolean
     FormClass.insertLogHistory("Hello world")
End Function

When the procedure is called, no data is added. Any idea why?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question