• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

How to read the text in textbox in limit?

Hi! I have a textbox name text1.text it has a word "Schedule" I want to read this using msgbox button only the first five letters. How?

Private Sub Command1_Click()
MsgBox Text1.Text ' here I want only the first five letters will read the msgbox
End Sub
0
Whing Dela Cruz
Asked:
Whing Dela Cruz
3 Solutions
 
yesthatbobCommented:
MsgBox Left(Text1.Text, 5)

Open in new window

0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Use the Left() function:
http://msdn.microsoft.com/en-us/library/aa445061(VS.60).aspx

    MsgBox Left(Text1.Text, 5)
0
 
Brook BraswellApplication Development ManagerCommented:
You could also use the Mid function and then should you need to change what you read, the second through sixth char this would work...

Private Sub Command1_Click()
    MsgBox Mid(Text1.Text,1,5)
End Sub
0
 
Whing Dela CruzAuthor Commented:
Thanks! All are working...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now