May 25, 2015 03:45 PM
(This post was last modified: Jan 27, 2016 09:03 AM by Odus.)
Today I bring you a fully featured notepad clone. Not very exciting, but the aim here is to show you just how flexible the TextBox control can be since I've seen a lot of people recommending the RichTextBox for functionality already existing in the standard TextBox. Most of us, myself included, don't dig much deeper than the multiline and text properties when it offers so much more.
Feature list:
Some of these are readily achievable through existing methods (cut, copy, etc.) but others such as the find & replace work makes use of Regex which is done by checking if this is the first time searching with this term (in other words, we're not in the middle of a search already) and if we are, generate a new Regex pattern. I should also note it's easy to accommodate pattern searching; but the real Notepad doesn't support this... so neither will this.
From there we conduct the search and point the selection to the first match through the SelectionStart/Length properties. If it there is no match to present, we inform the user and conclude the search. Changing the other controls for example reversing the search pattern will reset the search.
Anyway, enough blabbing. This can all be viewed in the source.
Demonstration: (Click to View)
Downloads:
Full source (GitHub)
Binary only (Mediafire) - virus scan
Known issues:
-FontDialog doesn't accept decimal as size input. I can't find a workaround for this, even when digging around the CommonDialog lib.
Credits:
Notepad icon: http://www.iconarchive.com/show/circle-a...-icon.html
Boogie tester: hackforums.net/member.php?action=profile&uid=1676753
Feature list:
- Create, open, save [as]
- Undo, cut, copy, paste, select all
- Word wrap, font changing via dialog, tab recognition
- Find and replace single or multiple instanced search term in asc/descending order with optional case sensitivity
- Line & column counting (through status strip)
- Configure and print document
- Insert chrono-data
Some of these are readily achievable through existing methods (cut, copy, etc.) but others such as the find & replace work makes use of Regex which is done by checking if this is the first time searching with this term (in other words, we're not in the middle of a search already) and if we are, generate a new Regex pattern. I should also note it's easy to accommodate pattern searching; but the real Notepad doesn't support this... so neither will this.
From there we conduct the search and point the selection to the first match through the SelectionStart/Length properties. If it there is no match to present, we inform the user and conclude the search. Changing the other controls for example reversing the search pattern will reset the search.
Anyway, enough blabbing. This can all be viewed in the source.
Demonstration: (Click to View)
Downloads:
Full source (GitHub)
Binary only (Mediafire) - virus scan
Known issues:
-FontDialog doesn't accept decimal as size input. I can't find a workaround for this, even when digging around the CommonDialog lib.
Credits:
Notepad icon: http://www.iconarchive.com/show/circle-a...-icon.html
Boogie tester: hackforums.net/member.php?action=profile&uid=1676753




![[Image: 5cb057d26344b19816219113f25e568d.png]](https://i.gyazo.com/5cb057d26344b19816219113f25e568d.png)
![[Image: LwmaiT6.png]](https://i.imgur.com/LwmaiT6.png)
![[Image: 1zL3pDG.jpg]](https://i.imgur.com/1zL3pDG.jpg)
![[Image: jlscvfi.png]](https://i.imgur.com/jlscvfi.png)