Using Classes

sjn78

Junior Contributor
Joined
May 4, 2003
Messages
255
Location
Australia
I have just begun using classes (god bless them) and still learning how to do functions with them.

Is there a way to set up a class to read the text in a text box.

EG.

Have a textbox and its text is 'Testing"

Now, can i call a a class, say getvalue(), and have the string 'Testing' associated with it so I can use it in another sub.

eg, msgbox ("The Text Box is " & getvalue())


Is this possible

Thanks

Steve
 
I would not recommend creating another class for reading the text of a textbox.

That can best be done in the class (most likely a form or derivative) that the textbox is in.

reading your text, i get the feeling you are mixing up methods and classes.

I think this is what you need

private function Testing() as String
return Textbox.text
End function

nothing class related. If you want to use this in other classes, make it public in stead of private.
 
Thanks for that. That is the way I would of use to of done it, but since learning about classes, I havent got my head around where and when they should be used.

Still learning everyday though.

Thanks
 
Back
Top