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
  1. Home
  2. General Programming
  3. C#
  4. How to work with Method : Find in richTextBox

How to work with Method : Find in richTextBox

Scheduled Pinned Locked Moved C#
helptutorial
4 Posts 2 Posters 0 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.
  • L Offline
    L Offline
    Laji59
    wrote on last edited by
    #1

    I want to set two find options : "MachCase" and "WholeWord" this code works correctly : richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase); but this code doesn`t work; It has compiler Error : richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord); How should I write this code to set either RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord

    Hello Friends

    P 1 Reply Last reply
    0
    • L Laji59

      I want to set two find options : "MachCase" and "WholeWord" this code works correctly : richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase); but this code doesn`t work; It has compiler Error : richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord); How should I write this code to set either RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord

      Hello Friends

      P Offline
      P Offline
      Pedram Behroozi
      wrote on last edited by
      #2

      Laji59 wrote:

      richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord);

      If you noticed, RichTextBox.Find method has two arguments: string str, RichTextBoxFinds option. So you have error. You should ask your user which option he/she wants. MatchCase OR WholeWord

      L 1 Reply Last reply
      0
      • P Pedram Behroozi

        Laji59 wrote:

        richTextBox1.Find(StrSearch, RichTextBoxFinds.MatchCase, RichTextBoxFinds.WholeWord);

        If you noticed, RichTextBox.Find method has two arguments: string str, RichTextBoxFinds option. So you have error. You should ask your user which option he/she wants. MatchCase OR WholeWord

        L Offline
        L Offline
        Laji59
        wrote on last edited by
        #3

        I know. But May be an User have either "MachCase" and "WholeWord" even more like "search Foreward or Backward". This ability is also in Standard application like Microsoft Word or Visual Studio

        Hello Friends

        P 1 Reply Last reply
        0
        • L Laji59

          I know. But May be an User have either "MachCase" and "WholeWord" even more like "search Foreward or Backward". This ability is also in Standard application like Microsoft Word or Visual Studio

          Hello Friends

          P Offline
          P Offline
          Pedram Behroozi
          wrote on last edited by
          #4

          Well simply search your text with MatchCase if Find can't find anything (returns -1) search for WholeWord.

          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