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. Keeping select visible when losing focus?

Keeping select visible when losing focus?

Scheduled Pinned Locked Moved C#
questionannouncement
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.
  • P Offline
    P Offline
    Paul Riley
    wrote on last edited by
    #1

    Okay, here's a simplified version of what I'm trying to do. I have a RichTextBox in a form for editing a text file; I've written a simple Find/Replace dialog (whose parent is the textbox itself). Currently, when you hit "Find", it has to close the dialog so that you can see the selected text (selected by the RichTextBox.Find function). You can then use F3 to find again. If a RichTextBox doesn't have focus then the selection isn't visible, so there's no benefit to keeping the dialog open. But what I'd really like to do is keep the Find/Replace dialog open while someone does as many find and replaces as they want. Any ideas out there? Paul And you run and you run to catch up with the sun, but it's sinking
    Racing around to come up behind you again
    The sun is the same in a relative way, but you're older
    Shorter of breath, one day closer to death
    - Pink Floyd, Time

    F 1 Reply Last reply
    0
    • P Paul Riley

      Okay, here's a simplified version of what I'm trying to do. I have a RichTextBox in a form for editing a text file; I've written a simple Find/Replace dialog (whose parent is the textbox itself). Currently, when you hit "Find", it has to close the dialog so that you can see the selected text (selected by the RichTextBox.Find function). You can then use F3 to find again. If a RichTextBox doesn't have focus then the selection isn't visible, so there's no benefit to keeping the dialog open. But what I'd really like to do is keep the Find/Replace dialog open while someone does as many find and replaces as they want. Any ideas out there? Paul And you run and you run to catch up with the sun, but it's sinking
      Racing around to come up behind you again
      The sun is the same in a relative way, but you're older
      Shorter of breath, one day closer to death
      - Pink Floyd, Time

      F Offline
      F Offline
      Furty
      wrote on last edited by
      #2

      Try passing a reference to your RichTextBox to the find form, and calling the RichTextBox.Find method from the actual find form. Make sure you use the Show() method to open your find form, rather then the ShowDialog() method.

      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