pckm_123 Posted December 19, 2003 Posted December 19, 2003 I have a form, and one class on the form, there is text field to display the messages 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 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 Quote
Moderators Robby Posted December 19, 2003 Moderators Posted December 19, 2003 Instead of DisplayMessage being a sub it should be a function that returns a string. public function DisplayMessage () as string return "hello..." end function Quote Visit...Bassic Software
pckm_123 Posted December 20, 2003 Author Posted December 20, 2003 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 Quote
*Experts* Bucky Posted December 21, 2003 *Experts* Posted December 21, 2003 It sounds like you need to use Response.Write(). Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.