Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Find Button

Find Button

Scheduled Pinned Locked Moved C#
helpquestion
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alwz_nikhil
    wrote on last edited by
    #1

    Hi.. I have some text text in RichTextBox ..And i want to search for some text. If that text appears more than one time it should select all that occurances. Is it possible to do that? Wat im using curently is as follows.. int startindex = 0; int tmp = rtxbox.Text.ToUpper().IndexOf(txtFind.Text.ToUpper()); if (tmp > -1 && rtxbox.Text.Length > 0) { startindex = tmp; rtxbox.Find(txtFind.Text); rtxbox.rtxbox.ScrollToCaret(); } this only selects the first occurance of that text.. help me out

    C 1 Reply Last reply
    0
    • A alwz_nikhil

      Hi.. I have some text text in RichTextBox ..And i want to search for some text. If that text appears more than one time it should select all that occurances. Is it possible to do that? Wat im using curently is as follows.. int startindex = 0; int tmp = rtxbox.Text.ToUpper().IndexOf(txtFind.Text.ToUpper()); if (tmp > -1 && rtxbox.Text.Length > 0) { startindex = tmp; rtxbox.Find(txtFind.Text); rtxbox.rtxbox.ScrollToCaret(); } this only selects the first occurance of that text.. help me out

      C Offline
      C Offline
      CodyGen
      wrote on last edited by
      #2

      You might try checking this out: http://www.dotnetjunkies.com/Tutorial/195E323C-78F3-4884-A5AA-3A1081AC3B35.dcik[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups