Solved

TextBox (Visual Basic)

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

910 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

23 Experts available now in Live!

Get 1:1 Help Now