Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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.

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...