Solved

TextBox (Visual Basic)

Posted on 2003-11-13
2
450 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: 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

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.
This article will show, step by step, how to integrate R code into a R Sweave document
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…
Starting up a Project

734 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