Use Find/Replace dialogs in .NET

The .NET Framework doesn’t include support for the find/replace common dialog. Of course you can write a custom dialog based on Windows Forms, but then you loose the standard look and feel.

The Win32 common dialog uses a custom message to notify the parent that the user pressed a button. While it works fine in the Win32 world, it doesn’t integrate well with Windows Forms application, because you need to override the WndProc and deal with unmanaged structures.

I created a custom class that deals with all Win32 stuff and translates it into a dialog that integrates a lot better in Windows Forms application. Full source-code is included with a sample application. I have provided no documentation, but I guess it’s pretty self explaining.

Click for Find/Replace demo project (including source code).

3 thoughts on “Use Find/Replace dialogs in .NET

  1. Just wanted to let you know that this was really helpful – exactly what I needed + very easy to use. Thanks!

  2. Pingback: Find/Replace dialog box | keyongtech

  3. Fantastic work, Ramon. Thank you very much for this amazing implementation.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>