Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TextBox (Visual Basic)

Posted on 2003-11-13
2
Medium Priority
?
465 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

772 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