I designed a window shape in which I placed 3 buttons and a richtextBox.Now I want to get the program code in richtextbox with different button presses, which I wrote in the click () event of each button.
Example
private void button1_Click(object sender, ButtonEventArgs e) { some code lines goes here // .... // All these lines to be displayed in richtextBox .... // }
I think you will need to actually connect and read the source files for this. After your application is compiled, your C # code becomes IL code and does not look the same at all.
When you execute, it no longer has a source, since it is compiled to IL, if you want to display a line when a button is clicked, just do it.
richTextBox.Text = @"some code lines goes here... ... ...";