posting message on the form

pckm_123

Newcomer
Joined
Aug 4, 2003
Messages
7
I have a form, and one class
on the form, there is text field to display the messages

Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim a As  myClass
a.DisplayMessage
End Sub

in the class
Code:
Public Class myClass

Sub DisplayMessage()
 form.msg = "hello.. this is message from myClass"
End Sub

End Class
how can I display message on the form from the class function
 
Instead of DisplayMessage being a sub it should be a function that returns a string.

Visual Basic:
public function DisplayMessage () as string 
    return "hello..."
end function
 
no.. I've should clearify about my class before
here what I want to do.
I have Form1 and Class myClass

instead of having and calling myClass methods like

myClass.DisplayMessage()
myClass.DoFirst()
myClass.DisplayMessage()
myClass.DoSecond()
myClass.DisplayMessage()
myClass.DoThird()

I want to call myClass.DoSomething() from Form1.

Let's say DoSomething() have to display messages on the Form1 several times within scope of its method.

what i want DoSomething() to do is
display the message on the form, like "about to do....1".
then.. do whatever have to and display another message on the Form again like "about to do ..2"
because doing second is depending on first one... and the third one to do is depending on second one..
So if I take your advised, I have to devide everthing into pieaces which will be really painful for me..
If I know the way to display the message to the Form from myClass that would be really really useful.

Thank you
 
Back
Top