Results 1 to 4 of 4

Thread: highlight text

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870

    highlight text

    Hi,

    I need to be able to seach a text box for a string and if it is contained highlight it(much like the 'find' on IE.)

    I know how to search the textbox using instr, but how do i highight the text? In VB6 it used to be selStart and selLength or something but can't do it in asp.net.

    Thanks
    Nick
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    Check the following
    Code:
    SelectedText - Gets or sets a value indicating the currently selected text in the control.
    SelectionLength - Gets or sets the number of characters selected in the text box.
    SelectionStart - Gets or sets the starting point of text selected in the text box.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    yeah i found that but i think that only works for windows controls, not webcontrols.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You are working with a stateless and limited GUI environment. Somethings will have to be done client side. So, ASP.NET can't do this for you, but I believe you can do what you want with javascript. You should look in that direction.

    Here, maybe this will get you started:
    http://www.planetsourcecode.com/vb/s...d=197&lngWId=2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width