SteadySelection Class

  • Thread starter Thread starter carlmanaster
  • Start date Start date
C

carlmanaster

Hi,

I needed this for my current project and thought it might be useful to
someone else. It's a simple Disposable class that preserves a
RichTextBox's selection, used like this:

// using (new SteadySelection(rtb))
// {
// rtb.SelectAll();
// rtb.SelectionColor = Color.Red;
// }

Because I know how mangled indentation becomes in newsgroups, I pasted
it here:

http://rafb.net/paste/results/icViTc91.html

Enjoy,
--Carl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top