Solved

TextBox (Visual Basic)

Posted on 2003-11-13
2
439 Views
Last Modified: 2010-04-17
i need to get position of a text file in textbox. exmple:
textbox with value of 123456. when using mouse highlighted 2345. i can get positon as 2 ... 5. The meaning is can know number 2 is located at positon 2 and last text highlighted which 5 located in position 5.

how to i program in Visual basic
0
Comment
Question by:cyseng10
2 Comments
 
LVL 14

Accepted Solution

by:
Thandava Vallepalli earned 50 total points
ID: 9745850
Hello Try with this....


Private Sub Command1_Click()
    If Len(Trim(Text1.SelText)) <> 0 Then
        MsgBox (Text1.SelStart + 1 & " ... " & (Text1.SelLength + Text1.SelStart))
    End If
End Sub


all the best,
V.Thandava Krishna.
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9746043
thats right use selstart and sellength properties
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question