Solved

TextBox (Visual Basic)

Posted on 2003-11-13
2
432 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
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.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now