Salam (Peace) everyone! I've recently started learning C# coding. After mastering the basics and console apps, I've moved on to GUI using WinForms to gain more experience and develop my skills in C#. I hope someone here can assist me in developing this notepad application. I'm facing several issues, particularly with the find & replace feature. I've tried numerous times, but unfortunately, it's not working for me :( Your help would be greatly appreciated. Thank you!
GitHub: DZ-T/Notepad (the website doesn't allow me to post my link)
I just code new version with better functions. I faced a problem in replace & find so i delete the code till i find a solution Thanks again. Let's make this Notepad less "stupid" and more awesome together!

Dharmeshwaran SRank #819 · 2.8K reputationPosted Jun 21, 2024, 10:54 PM EDT
Try using below code for Find Functionality
using System; using System.Windows.Forms; namespace NotepadApp { public partial class FindForm : Form { private TextBox textBox; private int startIndex = 0; public FindForm(TextBox textBox) { InitializeComponent(); this.textBox = textBox; } private void findNextButton_Click(object sender, EventArgs e) { string searchText = findTextBox.Text; startIndex = textBox.Text.IndexOf(searchText, startIndex); if (startIndex != -1) { textBox.Select(startIndex, searchText.Length); textBox.ScrollToCaret(); startIndex += searchText.Length; } else { MessageBox.Show("Text not found", "Find", MessageBoxButtons.OK, MessageBoxIcon.Information); startIndex = 0; } } } }Riddhi ValechaRank #794 · 2.9K reputationPosted Jun 24, 2024, 7:28 AM EDT
Hello,
Please check the post -
https://www.c-sharpcorner.com/UploadFile/1e050f/process-class-in-C-Sharp/
I think - The following code will be of your use -
using System; using System.Diagnostics;
using System.Threading;
class program { static void Main() { Process.Start("notepad"); //Wordpad open after 1 sec Thread.Sleep(1000); Process.Start("wordpad"); } }