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. Managed C++/CLI
  4. I couldn,t able to select

I couldn,t able to select

Scheduled Pinned Locked Moved Managed C++/CLI
database
2 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.
  • R Offline
    R Offline
    rose196
    wrote on last edited by
    #1

    Hai I am using richtextbox. I want to select some specific word, for that i used richtextbox select command. But i couldn,t select the word can you tell me what i was written is correct or wrong. String ^ searchString = this->functionBox->Text; String^ srcText = this->srcTextBox->Text; bool function = srcText->Contains(searchString); if(function) { int lengthofsearchString = searchString->Length; int index = srcTextBox->Find(searchString, 0, RichTextBoxFinds::MatchCase); if(index >= 0) { index = srcTextBox->Find(searchString, index + lengthofsearchString, RichTextBoxFinds::MatchCase); if(index>=0) { srcTextBox->Select(index,lengthofsearchString); //srcTextBox->SelectionColor = Color::Red; } } } can you tell me Thanks.

    M 1 Reply Last reply
    0
    • R rose196

      Hai I am using richtextbox. I want to select some specific word, for that i used richtextbox select command. But i couldn,t select the word can you tell me what i was written is correct or wrong. String ^ searchString = this->functionBox->Text; String^ srcText = this->srcTextBox->Text; bool function = srcText->Contains(searchString); if(function) { int lengthofsearchString = searchString->Length; int index = srcTextBox->Find(searchString, 0, RichTextBoxFinds::MatchCase); if(index >= 0) { index = srcTextBox->Find(searchString, index + lengthofsearchString, RichTextBoxFinds::MatchCase); if(index>=0) { srcTextBox->Select(index,lengthofsearchString); //srcTextBox->SelectionColor = Color::Red; } } } can you tell me Thanks.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Your code works fine for me. Mark

      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